Skip to main content

Mistral AI API

Mistral AI API is available on the Spanway gateway through the mistral/ model prefix. You register a Mistral AI API model once in the gateway's config.yaml (or through the Admin UI), and every application then calls it through the gateway's OpenAI-compatible API with a Spanway virtual key. The provider credential stays on the gateway, and every request is authenticated, rate limited, logged and costed in the same way as any other provider.

The gateway translates requests and responses for Mistral AI API natively, so provider specific parameters and errors are mapped to the OpenAI format for you.

Supported endpoints​

The gateway's endpoint support matrix lists the following endpoints for Mistral AI API. Each link explains the request shape and the gateway features that apply to that endpoint.

Model types​

The bundled price map lists 69 Mistral AI API models across these modes: Chat, Embedding, Transcription, Text to speech, OCR, Moderation. The mode decides which gateway endpoint a model is meant for, and it is also used by the gateway's health checks to send the right kind of test request.

Environment variables​

The Mistral AI API integration reads the following environment variables. Variables marked as required are the ones the gateway's environment validation checks for this provider. You can also pass any of these values directly in spanway_params (for example api_key or api_base), and the per-model value wins over the environment.

VariableRequiredPurpose
MISTRAL_API_KEYYesCredential the gateway sends to the provider
REPLICATE_API_TOKENNoCredential the gateway sends to the provider
MISTRAL_AZURE_API_BASENoOverrides the provider base URL
MISTRAL_AZURE_API_KEYNoCredential the gateway sends to the provider
MISTRAL_API_BASENoOverrides the provider base URL

Reference a variable from config.yaml with the os.environ/ prefix so that the secret never appears in the file itself. Secrets can also come from a secret manager, see secret managers.

Register a model on the gateway​

Add an entry to model_list in config.yaml. The model_name is the public name your applications send, and spanway_params.model tells the gateway which provider and upstream model to call.

model_list:
- model_name: mistral-large-3
spanway_params:
model: mistral/mistral-large-3
api_key: os.environ/MISTRAL_API_KEY

Start the gateway with this file:

export MISTRAL_API_KEY="..."
spanway --config config.yaml
Private preview

Spanway is in private preview. The container images and Helm charts will be published soon. To request access, write to sales@spanway.ai, and preview customers receive download instructions in their onboarding pack.

To add the model without a restart, call POST /model/new with the same model_name and spanway_params, or use the Models + Endpoints page in the Admin UI. See model management for details.

Call the model through the gateway​

Send requests to the gateway's /v1/chat/completions endpoint with a virtual key. The gateway maps the public model name to the Mistral AI API deployment, translates the request, and returns the response in the OpenAI format.

curl -X POST http://localhost:4000/v1/chat/completions \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral-large-3",
"messages": [{"role": "user", "content": "Summarize what an AI gateway does in two sentences."}]
}'

The same request works from any OpenAI SDK by setting the base URL to http://localhost:4000 and the API key to a Spanway virtual key. Create keys with POST /key/generate as described in virtual keys.

Models and pricing​

The table lists every Mistral AI API model in the gateway's bundled price map. Prices are shown in US dollars per 1 million tokens, computed from the per-token values the gateway uses for spend tracking. Context window sizes are the provider limits recorded in the same file. Capabilities are the supports_* flags set for each model.

info

Prices come from the price map bundled with this Spanway build. They are used to calculate the spend recorded for each request, key, team and user. Your negotiated rates may differ, and you can override them per deployment with custom pricing.

Model (model value)ModeMax input tokensMax output tokensInput per 1M tokensOutput per 1M tokensOther pricingCapabilities
mistral/codestral-2508Chat128,000128,000$0.3$0.9tools, structured output
mistral/codestral-embedEmbedding8,192$0.15
mistral/codestral-embed-2505Embedding8,192$0.15
mistral/codestral-latestChat128,000128,000$0.3$0.9tools, structured output
mistral/codestral-mamba-latestChat256,000256,000$0.25$0.25
mistral/devstral-latestChat256,000256,000$0.4$2.00tools, structured output
mistral/devstral-medium-latestChat256,000256,000$0.4$2.00tools, structured output
mistral/devstral-small-latestChat256,000256,000$0.1$0.3tools, structured output
mistral/glm-5-2Chat1,048,576131,072$1.40$4.40tools, reasoning, prompt caching, structured output
mistral/labs-leanstral-1-5Chat262,144131,072$0$0tools, structured output
mistral/labs-leanstral-1-5-1Chat262,144131,072$0$0tools, structured output
mistral/magistral-medium-latestChat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/magistral-small-latestChat262,144262,144$0.15$0.6tools, vision, reasoning, structured output
mistral/ministral-3-3b-2512Chat131,072131,072$0.1$0.1tools, vision, structured output
mistral/ministral-3-8b-2512Chat262,144262,144$0.15$0.15tools, vision, structured output
mistral/ministral-3-14b-2512Chat262,144262,144$0.2$0.2tools, vision, structured output
mistral/ministral-3b-2512Chat131,072131,072$0.1$0.1tools, vision, structured output
mistral/ministral-3b-latestChat131,072131,072$0.1$0.1tools, vision, structured output
mistral/ministral-8b-2512Chat262,144262,144$0.15$0.15tools, vision, structured output
mistral/ministral-8b-latestChat262,144262,144$0.15$0.15tools, vision, structured output
mistral/ministral-14b-2512Chat262,144262,144$0.2$0.2tools, vision, structured output
mistral/ministral-14b-latestChat262,144262,144$0.2$0.2tools, vision, structured output
mistral/mistral-code-agent-latestChat256,000256,000$0.4$2.00tools, structured output
mistral/mistral-code-fim-latestChat128,000128,000$0.3$0.9tools, structured output
mistral/mistral-code-latestChat128,000128,000$0.3$0.9tools, structured output
mistral/mistral-embedEmbedding8,192$0.1
mistral/mistral-embed-2312Embedding8,192$0.1
mistral/mistral-large-3Chat262,144262,144$0.5$1.50tools, vision, structured output
mistral/mistral-large-4Chat1,048,576$0.68$2.09tools, vision, reasoning, prompt caching, structured output
mistral/mistral-large-4-0Chat1,048,576$0.68$2.09tools, vision, reasoning, prompt caching, structured output
mistral/mistral-large-2512Chat262,144262,144$0.5$1.50tools, vision, structured output
mistral/mistral-large-latestChat262,144262,144$0.5$1.50tools, vision, structured output
mistral/mistral-mediumChat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/mistral-medium-3Chat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/mistral-medium-3-5Chat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/mistral-medium-3.5Chat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/mistral-medium-2604Chat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/mistral-medium-latestChat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/mistral-moderation-2603Moderation131,072$0$0
mistral/mistral-ocr-3OCR
mistral/mistral-ocr-3-0OCR
mistral/mistral-ocr-4OCR
mistral/mistral-ocr-4-0OCR
mistral/mistral-ocr-4-1OCR
mistral/mistral-ocr-2512OCR
mistral/mistral-ocr-latestOCR
mistral/mistral-smallChat32,0008,191$0.1$0.3tools, structured output
mistral/mistral-small-2603Chat262,144262,144$0.15$0.6tools, vision, reasoning, structured output
mistral/mistral-small-latestChat262,144262,144$0.15$0.6tools, vision, reasoning, structured output
mistral/mistral-tinyChat32,0008,191$0.25$0.25structured output
mistral/mistral-vibe-cli-fastChat262,144262,144$0.15$0.6tools, vision, reasoning, structured output
mistral/mistral-vibe-cli-latestChat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/mistral-vibe-cli-with-toolsChat262,144262,144$1.50$7.50tools, vision, reasoning, structured output
mistral/open-mistral-nemoChat128,000128,000$0.3$0.3structured output
mistral/pixtral-large-latestChat128,000128,000$2.00$6.00tools, vision, structured output
mistral/voxtral-mini-2602Transcription$0.00005 per input secondaudio in
mistral/voxtral-mini-latestTranscription$0.00005 per input secondaudio in
mistral/voxtral-mini-realtime-2602Transcription$0.0001 per input secondaudio in
mistral/voxtral-mini-realtime-latestTranscription$0.0001 per input secondaudio in
mistral/voxtral-mini-transcribe-realtime-2602Transcription$0.0001 per input secondaudio in
mistral/voxtral-mini-transcribe-realtime-latestTranscription$0.0001 per input secondaudio in
mistral/voxtral-mini-tts-2603Text to speech$16 per 1M charactersaudio out
mistral/voxtral-mini-tts-latestText to speech$16 per 1M charactersaudio out
mistral/voxtral-small-2507Chat32,76832,768$0.1$0.4tools, structured output, audio in
mistral/voxtral-small-latestChat32,76832,768$0.1$0.4tools, structured output, audio in
mistral/zai-glm-5Chat1,048,576131,072$1.40$4.40tools, reasoning, prompt caching, structured output
mistral/zai-glm-5-2Chat1,048,576131,072$1.40$4.40tools, reasoning, prompt caching, structured output
mistral/zai-glm-5-3Chat1,048,576131,072$1.40$4.40tools, reasoning, prompt caching, structured output
mistral/zai-glm-latestChat1,048,576131,072$1.40$4.40tools, reasoning, prompt caching, structured output