Skip to main content

Endpoint Families

Endpoint families are OpenAI-compatible APIs beyond chat that one shared gateway layer serves for several providers. You call them with a Quilr key under /openai_compatible/v1/. The gateway picks the provider from the app's configured providers and the request model, rewrites the request for the vendor where needed, and returns an OpenAI-shaped response.

Families and providers​

FamilyDefaultEndpointsProvidersStreaming
moderationsOnPOST /moderationsopenai, mistral, general-
imagesOnPOST /images/generationsopenai, azureopenai, xai, gemini_chatcompletions, general-
POST /images/editsopenai, general, azureopenai (multipart), xai (JSON)-
POST /images/variationsopenai (multipart)-
ocrOnPOST /ocr (Mistral request shape)mistral-
completionsOnPOST /completionsopenai, azureopenai, mistral (Codestral FIM), deepseek (FIM beta), general✓
filesOffPOST, GET /files; GET, DELETE /files/{file_id}; GET /files/{file_id}/contentopenai, azureopenai, mistral, xai-
batchesOffPOST, GET /batches; GET /batches/{batch_id}; POST /batches/{batch_id}/cancel; GET /batches/{batch_id}/results (xAI only)openai, azureopenai, mistral, xai-
videosOffPOST /videos; GET /videos/{video_id}; POST /videos/edits (xAI only); GET /videos, DELETE /videos/{video_id}, GET /videos/{video_id}/content (OpenAI only)openai, xai-

Every path also works without /v1 (for example /openai_compatible/moderations).

What changed for each provider​

Provider typeFamilies it now serves
mistral (new)moderations, ocr, completions (FIM), files, batches
xai (new)images (generations, edits), files, batches, videos
openaimoderations, images, completions, files, batches, videos
azureopenaiimages (generations, edits), completions, files, batches
gemini_chatcompletionsimages (generations)
deepseekcompletions (FIM through DeepSeek's beta endpoint)
generalmoderations, images (generations, edits), completions

The new providers also serve existing endpoints: mistral serves chat, embeddings and transcription, xai serves chat, and xai_responses serves the Responses API. See Mistral AI and xAI Grok.

Vendor adapters​

  • Mistral moderations add OpenAI's per-result flagged field.
  • Mistral FIM maps /completions to Mistral's /v1/fim/completions, maps seed to random_seed, drops fields Mistral does not accept and returns OpenAI choices[].text, including in stream events.
  • Mistral batches map to Mistral's batch jobs API, with job statuses converted to OpenAI's.
  • xAI images drop OpenAI-only fields (size, quality, style, background, moderation, output_compression, output_format, user). Edits take a JSON body.
  • xAI videos map seconds to duration. xAI returns the result as video.url rather than a content download.

xAI is not in the completions family: xAI rejects /v1/completions for every current model.

Examples​

# Moderation (OpenAI or Mistral model)
curl https://guardrails.quilr.ai/openai_compatible/v1/moderations \
-H "Authorization: Bearer $QUILR_KEY" -H "Content-Type: application/json" \
-d '{"model": "mistral-moderation-latest", "input": "Some text to classify"}'

# Image generation
curl https://guardrails.quilr.ai/openai_compatible/v1/images/generations \
-H "Authorization: Bearer $QUILR_KEY" -H "Content-Type: application/json" \
-d '{"model": "grok-imagine-image", "prompt": "A plain white square.", "n": 1}'

# Batches and files route by provider label, not model
curl https://guardrails.quilr.ai/openai_compatible/v1/batches/batch_123 \
-H "Authorization: Bearer $QUILR_KEY" -H "X-Provider-Label: mistral-prod"

The OpenAI SDKs work unchanged: point base_url at https://<region>/openai_compatible/v1 and call client.moderations.create, client.images.generate or client.completions.create.

Choosing the provider​

  • Model-based calls (moderations, images, OCR, completions, and creating files, batches or videos): the gateway uses the enabled provider that has the requested model and serves that operation. model is required.
  • ID-based calls (/files/{file_id}, /batches/{batch_id}, /videos/{video_id}, and lists): IDs belong to the provider that created them. When more than one provider on the app can serve the call, send provider_label or X-Provider-Label. IDs must match [A-Za-z0-9][A-Za-z0-9._:@=-]{0,255}.
  • provider, provider_label, X-Provider-Name and X-Provider-Label work as on other endpoints and are removed before the request goes upstream.

What applies on family routes​

ControlApplies
Quilr key auth, identity and source-IP checks✓
Model allow-lists and model access✓
Routing groups✓
Rate, concurrency and token limits, quotas✓
Request logging✓
DLP guardrails (request or response)-
Not scanned by guardrails

Family routes are not scanned for sensitive data. A Policy Engine detection rule on these surfaces reports unsupported_route_capability. Use the chat, Responses or embeddings endpoints where content must be scanned, or restrict which models an app can reach.

Usage accounting: completions and images count tokens and spend like chat and enforce output-token limits. moderations, ocr, files, batches and videos count requests. An image response without token counts charges no tokens; the provider's usage is kept on the log.

Logging: each request is logged with its family and operation. Base64 payloads are left out of the log and logged bodies are capped (256 KiB by default). File and video downloads stream through byte for byte.

Enabling families​

Moderations, images, OCR and completions are on by default. Files, batches and videos are off by default because their ID-based calls are not tied to an app's model list. On self-hosted gateways the operator sets LLMGATEWAY_ENDPOINT_FAMILIES:

ValueResult
Unset or emptymoderations,images,ocr,completions
Comma-separated list, for example moderations,images,files,batchesOnly those families
allEvery family
noneNo family routes

On QuilrAI-hosted gateways, contact QuilrAI to turn on files, batches or videos.

SettingDefault
LLMGATEWAY_FAMILY_MAX_BODY_BYTES (maximum request body)100 MiB
LLMGATEWAY_FAMILY_LOG_MAX_BYTES (logged body cap)256 KiB
LLMGATEWAY_FAMILY_MAX_CONNECTIONS (upstream connection pool)100

Errors​

Errors use the OpenAI shape {"error": {"message", "type", "code"}}. Errors from the provider are passed through with their status, body and retry-after.

StatusCodeWhen
404endpoint_not_enabledThe family is turned off: The {family} endpoints are not enabled on this gateway.
400unsupported_provider_for_<family>The selected provider does not serve that operation.
400streaming_not_supportedstream: true on a non-streaming operation or provider.
400unsupported_content_typeWrong body type, for example multipart image edits to xAI.
400missing_required_parametermodel is missing.
400provider_label_requiredAn ID-based call matches several providers and has no label.
400provider_not_found, ambiguous_provider_labelThe label matches no provider, or several.
400invalid_path_parameterA file, batch or video ID has invalid characters.
403model_access_deniedThe model is not enabled on the labeled provider.
413request_too_largeThe body exceeds the size limit.