Mistral AI and xAI Grok
Mistral AI and xAI (Grok) are direct providers. You paste one API key and the gateway calls the vendor's own API. Your code keeps using a Quilr key and the standard gateway endpoints, so there is no Mistral- or xAI-specific path or model prefix. Clients on other formats (Responses, Anthropic Messages, Gemini, Bedrock) reach both through any-to-any formats.
Add the provider
- Open Settings > Models > Models and click Add your own models. The same picker appears when you create an app or edit an app's providers.
- Type
mistral,grokorxaiin Search provider types (placeholder: Search by vendor or API). Search is not case-sensitive and matches the vendor name, tagline, description and API names, so queries such asocr,imageorbatchalso find these tiles. - Select the Mistral AI or xAI tile. For xAI, choose Chat completions or Responses under Which API does the gateway talk to?. Mistral has one API, so there is no choice.
- Keep or edit the suggested Provider label and paste the API key. There is no Base URL, region or API version field: the upstream URL is fixed by QuilrAI, and any
base_urlsent through the Management API is ignored. - Click Check key and list models, select the models, set pricing and save. See Providers and Models for the full flow.
Model discovery
- Mistral lists models from
/v1/modelsand sorts each one into chat, embedding, moderation, OCR, transcription or FIM from Mistral's capability flags. Archived models are hidden. - xAI lists language models, plus image and video generation models where your key can reach them.
xai_responseslists language models only. - Selected chat models get a short test call when you validate them.
Enable every model you call, on every API. A Mistral embedding or OCR model has to be selected on the provider just like a chat model.
Call the gateway
Use a regional base URL and your Quilr key (Authorization: Bearer <Quilr key>).
Moderation, OCR, FIM, images, files, batches and videos are endpoint families. Files, batches and videos are off by default.
Examples
# Mistral chat
curl https://guardrails.quilr.ai/openai_compatible/v1/chat/completions \
-H "Authorization: Bearer $QUILR_KEY" -H "Content-Type: application/json" \
-d '{"model": "ministral-8b-latest", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 128}'
# Codestral fill-in-the-middle (streaming works too)
curl https://guardrails.quilr.ai/openai_compatible/v1/completions \
-H "Authorization: Bearer $QUILR_KEY" -H "Content-Type: application/json" \
-d '{"model": "codestral-latest", "prompt": "def add(a, b):\n return", "suffix": "\n\nprint(add(1, 2))", "max_tokens": 32}'
# Mistral document OCR (Mistral request shape)
curl https://guardrails.quilr.ai/openai_compatible/v1/ocr \
-H "Authorization: Bearer $QUILR_KEY" -H "Content-Type: application/json" \
-d '{"model": "mistral-ocr-latest", "document": {"type": "document_url", "document_url": "https://example.com/invoice.pdf"}}'
# Mistral transcription
curl https://guardrails.quilr.ai/openai_compatible/v1/audio/transcriptions \
-H "Authorization: Bearer $QUILR_KEY" \
-F file=@hello.wav -F model=voxtral-mini-latest
# xAI 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}'
from openai import OpenAI
client = OpenAI(base_url="https://guardrails.quilr.ai/openai_responses/v1", api_key=QUILR_KEY)
resp = client.responses.create(model="grok-4.20-0309-non-reasoning", input="Say hello", max_output_tokens=128)
print(resp.output_text)
If an app has several providers that serve the same model, pick one with provider_label or X-Provider-Label. See Selecting a Provider.
Provider behavior
Dropped fields are recorded on the request log.
Guardrails, routing and limits
- Chat, Responses, embeddings and transcription get the same guardrails as any other provider.
- Moderation, OCR, FIM, images, files, batches and videos are not scanned by DLP. Access controls, model allow-lists, rate and token limits and quotas still apply. See Endpoint Families.
- Routing groups:
mistralandxaiare own-family members of Chat Completions groups;xai_responsesof OpenAI Responses groups. See Routing and Fallbacks.