Mistral AI (Mistral Large / Small / Codestral)
LLMby Mistral AI
French AI company offering efficient open and commercial models. Mistral Large for complex reasoning, Mistral Small for cost-effective tasks, and Codestral for code generation. Known for strong European data privacy.
Registration & API Key Steps
Step 2
Verify your phone number to activate the free Experiment plan.
Step 3
Choose between Experiment (free) or Scale (pay-as-you-go) plan.
Step 4
Navigate to API Keys section and click "Create new key".
Step 5
Copy and securely store your API key.
Pricing
| Tier | Price | Features |
|---|---|---|
| Mistral Nemo | $0.02 / $0.06 per 1M tokens | Input / Output. Most affordable. Open-source. |
| Mistral Small | $0.10 / $0.30 per 1M tokens | Input / Output. Good for simple tasks. |
| Mistral Medium 3 | $0.40 / $2.00 per 1M tokens | Input / Output. Balanced performance. |
| Mistral Large | $2.00 / $6.00 per 1M tokens | Input / Output. Most capable for complex reasoning. |
| Codestral | $0.30 / $0.90 per 1M tokens | Input / Output. Specialized for code generation. |
Application Tips
Tip 1
Experiment plan is free — great for prototyping without credit card commitment.
Tip 2
Mistral Nemo at $0.02/1M input tokens is one of the cheapest commercial APIs.
Tip 3
Codestral is specifically optimized for code — use it for programming tasks.
Tip 4
EU-based servers ensure GDPR compliance, important for European customers.
Tip 5
API is OpenAI-compatible, making migration from OpenAI easy.
Tip 6
Open-source models (Mistral Nemo, Mixtral) can be self-hosted for free.
China Access Solutions
Access Solution
Requires VPN/proxy for API access. Consider self-hosting open-source Mistral models (Nemo, Mixtral) in China for local access.
Code Example
from mistralai import Mistral
client = Mistral(api_key="your-api-key")
response = client.chat.complete(
model="mistral-large-latest",
messages=[
{"role": "user", "content": "What is the best French cheese?"}
]
)
print(response.choices[0].message.content)
# --- cURL example ---
# curl https://api.mistral.ai/v1/chat/completions \
# -H "Authorization: Bearer your-api-key" \
# -H "Content-Type: application/json" \
# -d '{
# "model": "mistral-large-latest",
# "messages": [{"role": "user", "content": "Hello!"}]
# }'Rate Limits
| Tier | Limits |
|---|---|
| Default | Experiment (free): 1 RPM per model. Scale: varies by model, typically 5-50 RPM. Enterprise: custom limits. |
Recommended Use Cases
Related API Guides
OpenAI GPT-4o / GPT-4.1 / o3
OpenAI
OpenAI's flagship LLM family including GPT-4o for multimodal tasks, GPT-4.1 for long-context coding, and o3 for advanced reasoning. Industry-leading models with the largest developer ecosystem.
Anthropic Claude (Sonnet 4.5 / Opus 4.5)
Anthropic
Anthropic's Claude model family excels in nuanced reasoning, safety, and long-context tasks. Claude Sonnet 4.5 offers the best balance of cost and performance, while Opus 4.5 delivers frontier intelligence.
Google Gemini (2.5 Pro / 2.5 Flash)
Google's Gemini models offer a generous free tier, 1M token context window, and strong multimodal capabilities. Gemini 2.5 Pro leads in reasoning, while Flash models provide cost-effective alternatives.
Meta Llama 4 (Scout / Maverick)
Meta
Meta's open-source Llama 4 models are free to use and available through multiple cloud providers. Llama 4 Scout and Maverick offer competitive performance at extremely low cost through partner APIs.