Mistral AI API: endpoints, authentication, models and limits

Connection details

Base URLhttps://api.mistral.ai/v1
AuthBearer token via MISTRAL_API_KEY
OpenAI SDK compatibleYes
SDKsMistral SDK (Python, TypeScript), OpenAI SDK, raw HTTP

Models and token pricing

ModelModel IDContextIn / 1MOut / 1M
Mistral Large 2mistral-large-2411128K$2.00$6.00
Mistral Large 4mistral-large-41000K$0.700$2.10
Codestralcodestral-2501256K$0.300$0.900

Call Mistral Large 2 through Swfte Connect

Swfte Connect is an OpenAI-compatible gateway. One Connect key reaches this model and the other providers Connect is credentialed for, with failover and cost tracking on the same endpoint. Prices below are the provider list prices from our model directory; see the AI model price index to compare them with every other model.

Connect also accepts your own provider keys and can be self-deployed (designed for, on request). See Connect providers and BYOK and self-deploying Connect.

Mistral Large 2

Model ID on Connectmistral:mistral-large-latest
Context window128K tokens
Input / 1M tokens$2.00
Output / 1M tokens$6.00
curl https://api.swfte.com/agents/v2/gateway/chat/completions \
  -H "Authorization: Bearer $SWFTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mistral:mistral-large-latest",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Swfte Connect · Connect pricing · AI FinOps. Other Mistral AI models in the table above are listed for reference and are not offered through Connect here.

What is distinctive about this API

  • European provider with EU data residency, which is frequently the deciding factor rather than any model capability.
  • Dedicated code models and an embeddings endpoint sit alongside the chat models.
  • Several models ship under Apache 2.0, so the hosted API and a self-hosted deployment can run the same weights.

Constraints worth knowing first

  • Open-weight and commercial models carry different licences — check before assuming a model can be self-hosted.
  • Function-calling support varies across the family; the smaller models are more limited than the flagships.

Frequently asked

What is the Mistral AI API base URL?
https://api.mistral.ai/v1. Authenticate with a bearer token, conventionally read from the MISTRAL_API_KEY environment variable.
Is the Mistral AI API compatible with the OpenAI SDK?
Yes. The chat completions surface is wire-compatible, so the official OpenAI client libraries work by pointing base_url at https://api.mistral.ai/v1 and supplying a MISTRAL_API_KEY. No client library change is needed.
How do I get a Mistral AI API key?
Create an account with the provider and generate a key from the developer console, then expose it to your application as MISTRAL_API_KEY. Keys are secrets: keep them server-side, never in client bundles or committed config.
Can I call Mistral Large 2 through Swfte Connect?
Yes. Swfte Connect exposes Mistral Large 2 as mistral:mistral-large-latest behind one OpenAI-style chat completions endpoint (api.swfte.com/agents/v2/gateway). Create a Connect key and send the model ID in the request body. Other Mistral AI models in the table are listed for reference and are not offered through Connect on this page.
Which models does the Mistral AI API expose?
Mistral Large 2, Mistral Large 4, Codestral. Context windows run to 1000K tokens.

Other provider APIs

Mistral AI publishes official documentation at https://docs.mistral.ai. Pricing and limits change; verify against the provider before committing to a budget.

Deploy a model with Swfte Connect

One gateway, every provider, per-token cost visibility. Swap models without touching your code.