Mistral AI routing

Mistral AI router for OpenAI-compatible agents

Use Sage Router as the policy layer around Mistral and Codestral API routes. Keep MISTRAL_API_KEY under your custody, expose one OpenAI-compatible endpoint to agents, and fail over to other authorized coding, frontier, local, or multimodal routes when a key, model, or provider path is unhealthy.

Create API key Read quickstart Coding agents Browse models

Mistral API key custody

Configure Mistral as an authorized provider route using your own MISTRAL_API_KEY. Sage Router supports API-key mode; it does not grant unauthorized Mistral, Codestral, or La Plateforme access.

OpenAI-compatible setup

Point OpenAI SDKs, Codex, Cursor, Aider, Continue, OpenHands, and gateway-compatible clients at https://api.sagerouter.dev/v1 while the router chooses Mistral, Codestral, OpenAI, Anthropic, Gemini, Ollama, NVIDIA NIM, Bedrock, or private routes by policy.

Codestral routing

Route code tasks to customer-authorized Codestral or Mistral models when they are healthy, while keeping a fallback chain for reasoning, long-context, local, and multimodal workloads.

60-second Mistral setup

export OPENAI_BASE_URL=https://api.sagerouter.dev/v1
export OPENAI_API_KEY=sk_sage_your_generated_key
export MISTRAL_API_KEY=your_authorized_mistral_key

curl "$OPENAI_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sage-router/code",
    "messages": [{"role": "user", "content": "Use Mistral or Codestral if it is the best healthy authorized route"}]
  }'

Credential load balancing

Credential pools can distribute traffic across authorized Mistral keys and fail over when one key is exhausted, revoked, rate-limited, or unhealthy.

429 failover

Retryable rate limits can move to another eligible Mistral credential, OpenAI-compatible provider, local Ollama model, or private endpoint according to your policy.

Multimodal safeguards

Image, audio, video, and document inputs route only to capable models, so auto and agentic profiles do not send multimodal work to incompatible routes.

Provider authorization boundary

Sage Router sells routing, generated keys, quotas, account management, analytics, and reliability infrastructure. It does not include bundled Mistral resale, does not bypass Mistral terms, and does not grant unauthorized Mistral, Codestral, or La Plateforme access.

Next steps

Create an API key, copy the hosted quickstart, use the coding-agent setup, or estimate routing fit.