Mistral AI
The French platform: open models and a free tier to experiment with.
Mistral is the French lab behind the current Small and Medium line. Mixtral 8x7B retired from the API on 30 Mar 2025. The console still gives you a key on an email; Free mode and Labs are the no-card slice.
Context goes to 256K. Labs ids (labs- prefix) are free of charge; mistral-medium-3-5 is paid. Limits live per org in the console, not as a published “one request a second”. Use Small or a Labs model to try, not to ship.
- Free models
- 12
- Max context
- 256K
- Free tier
- Free mode and Labs
- Requirement
- Email account, no card
Endpoint
Base URL
https://api.mistral.ai/v1Env var
MISTRAL_API_KEYRate limit
Per-org caps in the console; Labs models are free of charge- OpenAI-compatible
- Native SDK: Mistral SDK
- text
- image
- code
Code examples
npm install openaiimport OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.mistral.ai/v1',
apiKey: process.env.MISTRAL_API_KEY
})
const response = await client.chat.completions.create({
model: 'mistral-small-latest',
messages: [{ role: 'user', content: 'Explain closures in one paragraph.' }]
})
console.log(response.choices[0].message.content)pip install openaiimport os
from openai import OpenAI
client = OpenAI(
base_url="https://api.mistral.ai/v1",
api_key=os.environ["MISTRAL_API_KEY"],
)
response = client.chat.completions.create(
model="mistral-small-latest",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response.choices[0].message.content)curl https://api.mistral.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MISTRAL_API_KEY" \
-d '{
"model": "mistral-small-latest",
"messages": [{"role": "user", "content": "Explain closures in one paragraph."}]
}'npm install @mistralai/mistralaiimport { Mistral } from '@mistralai/mistralai'
const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY })
const response = await client.chat.complete({
model: 'mistral-small-latest',
messages: [{ role: 'user', content: 'Explain closures in one paragraph.' }]
})
console.log(response.choices[0].message.content)pip install mistralaiimport os
from mistralai import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
response = client.chat.complete(
model="mistral-small-latest",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response.choices[0].message.content)Worth knowing
- open-mixtral-8x7b retired on 30 Mar 2025. Use mistral-small-latest or a labs- id.
- mistral-medium-3-5 is a paid model (256K). Free mode and Labs are the no-card slice.
Models you get for free12
- Mistral Small
mistral-small-latest - Mistral Small 2506
mistral-small-2506 - Mistral Nemo
open-mistral-nemo - Codestral
codestral-latest - Pixtral 12B
pixtral-12b-2409 - Labs Mistral Small
labs-mistral-small - Mistral Embed
mistral-embed - Mistral Moderation
mistral-moderation-latest - Mistral OCR
ocr-latest - Mistral Small 3.1
mistral-small-3.1-24b-instruct - Devstral Small
devstral-small-latest - Magistral Small
magistral-small-latest