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
Every path also works without /v1 (for example /openai_compatible/moderations).
What changed for each provider
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
flaggedfield. - Mistral FIM maps
/completionsto Mistral's/v1/fim/completions, mapsseedtorandom_seed, drops fields Mistral does not accept and returns OpenAIchoices[].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
secondstoduration. xAI returns the result asvideo.urlrather 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
modeland serves that operation.modelis 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, sendprovider_labelorX-Provider-Label. IDs must match[A-Za-z0-9][A-Za-z0-9._:@=-]{0,255}. provider,provider_label,X-Provider-NameandX-Provider-Labelwork as on other endpoints and are removed before the request goes upstream.
What applies on family routes
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:
On QuilrAI-hosted gateways, contact QuilrAI to turn on files, batches or videos.
Errors
Errors use the OpenAI shape {"error": {"message", "type", "code"}}. Errors from the provider are passed through with their status, body and retry-after.