Codestral API Pricing
As of October 10, 2026, Codestral costs $0.30 per 1M input tokens and $0.90 per 1M output tokens on Mistral AI, with cache reads at $0.03 per 1M tokens. Across 6 providers on LiteLLM, the input price ranges from $0 to $0.30. It has a 128,000-token context window and returns up to 128,000 tokens per response.
- Input
- $0.30 / 1M tokens
- Output
- $0.90 / 1M tokens
- Cache read
- $0.03 / 1M tokens
- Context window
- 128,000 tokens
- Max output
- 128,000 tokens
- Providers
- 6
- Added to LiteLLM
- June 2024
Codestral pricing by provider
11 listings across 6 providers. Token prices are in US dollars per 1M tokens. The highlighted row is the price quoted above.
| Provider | Model name in LiteLLM | Input | Output | Cache read | Context |
|---|---|---|---|---|---|
| Mistral AIsnapshot 2508 | mistral/codestral-2508 | $0.30 | $0.90 | $0.03 | 128K |
| Mistral AIlatest alias | mistral/codestral-latest | $0.30 | $0.90 | $0.03 | 128K |
| Azure AI Foundrysnapshot 2501 | azure_ai/Codestral-2501 | $0.30 | $0.90 | – | 256K |
| Codestralsnapshot 2405 | codestral/codestral-2405 | $0 | $0 | – | 32K |
| Codestrallatest alias | codestral/codestral-latest | $0 | $0 | – | 32K |
| Google Vertex AIsnapshot 2501 | vertex_ai/codestral-2501 | $0.20 | $0.60 | – | 128K |
| Google Vertex AI | vertex_ai/codestral@2405 | $0.20 | $0.60 | – | 128K |
| Google Vertex AI | vertex_ai/codestral@latest | $0.20 | $0.60 | – | 128K |
| Text Completion Codestralsnapshot 2405 | text-completion-codestral/codestral-2405 | $0 | $0 | – | 32K |
| Text Completion Codestrallatest alias | text-completion-codestral/codestral-latest | $0 | $0 | – | 32K |
| Vercel AI Gateway | vercel_ai_gateway/mistral/codestral | $0.30 | $0.90 | – | 256K |
What Codestral costs in practice
1,000 requests with 2,000 input and 500 output tokens each
| Mistral AI | $1.05 |
| Codestral | $0 |
| Text Completion Codestral | $0 |
| Google Vertex AI | $0.70 |
100 long-document requests with 100,000 input and 2,000 output tokens each
| Mistral AI | $3.18 |
| Codestral | $0 |
| Text Completion Codestral | $0 |
| Google Vertex AI | $2.12 |
Codestral features
- Function calling
- Structured output
Use Codestral with LiteLLM
Call Codestral through the LiteLLM Python SDK, or put it behind the LiteLLM proxy and send OpenAI-format requests to /v1/chat/completions. LiteLLM tracks the cost of every request at these prices.
from litellm import completion
response = completion(
model="mistral/codestral-2508",
messages=[{"role": "user", "content": "Hello!"}],
)model_list:
- model_name: codestral
litellm_params:
model: mistral/codestral-2508
api_key: os.environ/MISTRAL_API_KEYcurl http://0.0.0.0:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
"model": "codestral",
"messages": [{"role": "user", "content": "Hello!"}]
}'Codestral FAQ
How much does Codestral cost?
Codestral costs $0.30 per 1M input tokens and $0.90 per 1M output tokens on Mistral AI, with cache reads at $0.03 per 1M tokens. Across 6 providers on LiteLLM, the input price ranges from $0 to $0.30.
What is the context window of Codestral?
Codestral has a 128,000-token context window and returns up to 128,000 tokens per response.
Which providers offer Codestral?
Codestral is available from 6 providers through LiteLLM: Mistral AI, Azure AI Foundry, Codestral, Google Vertex AI, Text Completion Codestral and Vercel AI Gateway. The lowest price is on Codestral.
How do I call Codestral with an OpenAI-compatible API?
Use the LiteLLM Python SDK with model="mistral/codestral-2508", or add the model to the LiteLLM proxy's config.yaml and send requests to /v1/chat/completions from any OpenAI client. LiteLLM tracks the cost of every request at the prices on this page.
What features does Codestral support?
Codestral supports function calling and structured output.
When did LiteLLM add Codestral?
Codestral was added to LiteLLM's model price file in June 2024.
Sources
Prices come from LiteLLM's open-source model_prices_and_context_window.json, which LiteLLM uses to calculate the cost of every request. Provider pricing pages:
- docs.mistral.ai/models/model-cards/codestral-25-08
- prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'
- docs.mistral.ai/capabilities/code_generation/
LiteLLM docs: Mistral AI, Azure AI Foundry, Codestral, Google Vertex AI, Vercel AI Gateway.
Provider pages: Mistral AI, Azure AI Foundry, Codestral, Google Vertex AI, Text Completion Codestral, Vercel AI Gateway.
