AI API PricesMistral › Codestral

Codestral pricing

Codestral API cost from Mistral — $0.300 per 1M input tokens and $0.900 per 1M output tokens. Code-specialised. Estimate your real monthly bill below, then compare it against every other model.

Input price
$0.300
per 1M input tokens
Output price
$0.900
per 1M output tokens
Context window
32K
tokens per request
Reference call
$0.0012
1K in + 1K out

Balanced 32K context · all prices USD per 1M tokens, list price last verified 2026-06-27.

Codestral capabilities & limits

Representative specs for this tier — confirm exact limits in the Mistral docs.

Context window32K
Max output32K
Knowledge cutoff2025
API formatOpenAI-compatible
✓ Tools / functions✓ JSON / structured✓ Batch API

API acting up? Check Mistral status ↗ · all AI API status

Call Codestral from your code

The exact model string and endpoint to use. Works with the OpenAI SDK — just point base_url at the URL below.

Model stringcodestral-latest
Base URLhttps://api.mistral.ai/v1
API key envMISTRAL_API_KEY
curl https://api.mistral.ai/v1/chat/completions \
  -H "Authorization: Bearer $MISTRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "codestral-latest",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Model strings follow each provider's naming convention; confirm the current id in the Mistral docs before relying on it.

What a Codestral API call actually costs

Blended input + output cost at Codestral's list rates — useful yardsticks before you commit to volume.

$0.0012
Short call
1K in · 1K out
$0.0014
Chat turn
3K in · 500 out
$0.0069
RAG / long prompt
20K in · 1K out
$1.20
1M in + 1M out
bulk job

Codestral cost calculator

Enter your monthly volume to estimate the Codestral bill. Runs entirely in your browser.

Estimated monthly cost

For the full multi-model breakdown, use the cost calculator.

Mistral models — Codestral in context

How Codestral prices against its siblings. Cheapest reference cost first.

Model Input /1M Output /1M Cost / call* Context Type
Mistral Small 4 $0.150 $0.600 $0.0007 128K Fast / cheap
Codestral
Code-specialised
$0.300 $0.900 $0.0012 32K Balanced
Mistral Large 3
Flagship
$0.500 $1.50 $0.0020 256K Flagship
Mistral Medium 3.5 $1.50 $7.50 $0.0090 256K Balanced

*Reference cost of one call with 1,000 input + 1,000 output tokens — a neutral yardstick. Use the calculator for your real usage. Cheapest row highlighted.

Cheaper than Codestral? In the same balanced tier, Command R runs $0.150 in / $0.600 out. The overall cheapest model tracked is Gemini 1.5 Flash-8B — see the cheapest LLM API guide.

How Codestral pricing works

Codestral is billed per token: a lower input price of $0.300 per million tokens for everything you send, and a higher output price of $0.900 per million for everything the model generates. To turn that into a real Codestral bill, multiply by your monthly request volume and average prompt/response length — the calculator above does exactly that.

Codestral does not list a separate cached-input rate, so every input token bills at $0.300 per million. If repeated context is a big part of your prompts, a model with prompt caching may end up cheaper in practice.

List prices move fast — always confirm the current numbers on the official Mistral pricing page before relying on them for budgeting.

Codestral pricing FAQ

How much does the Codestral API cost?

Codestral costs $0.300 per 1M input tokens and $0.900 per 1M output tokens. A typical 3K-input / 500-output call works out to about $0.0014.

What is Codestral's context window?

Codestral has a 32K-token context window. Tokens you put in the prompt are billed at the $0.300 per 1M input rate.

Does Codestral charge extra for output tokens?

Yes. Output (generated) tokens cost $0.900 per 1M, versus $0.300 per 1M for input — about 3.0× more, which is normal for LLM APIs.

Is there a cheaper alternative to Codestral?

In the same balanced tier, Command R (Cohere) is cheaper at $0.150 in / $0.600 out. The overall cheapest model on the market is Gemini 1.5 Flash-8B.

Compare Codestral with other models