LiteLLMModels

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.

By Mistral AIModel ID mistral/codestral-2508Prices updated Checked
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.

ProviderModel name in LiteLLMInputOutputCache readContext
Mistral AIsnapshot 2508mistral/codestral-2508$0.30$0.90$0.03128K
Mistral AIlatest aliasmistral/codestral-latest$0.30$0.90$0.03128K
Azure AI Foundrysnapshot 2501azure_ai/Codestral-2501$0.30$0.90–256K
Codestralsnapshot 2405codestral/codestral-2405$0$0–32K
Codestrallatest aliascodestral/codestral-latest$0$0–32K
Google Vertex AIsnapshot 2501vertex_ai/codestral-2501$0.20$0.60–128K
Google Vertex AIvertex_ai/codestral@2405$0.20$0.60–128K
Google Vertex AIvertex_ai/codestral@latest$0.20$0.60–128K
Text Completion Codestralsnapshot 2405text-completion-codestral/codestral-2405$0$0–32K
Text Completion Codestrallatest aliastext-completion-codestral/codestral-latest$0$0–32K
Vercel AI Gatewayvercel_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

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.

Python SDK
from litellm import completion

response = completion(
    model="mistral/codestral-2508",
    messages=[{"role": "user", "content": "Hello!"}],
)
Proxy config.yaml
model_list:
  - model_name: codestral
    litellm_params:
      model: mistral/codestral-2508
      api_key: os.environ/MISTRAL_API_KEY
Call the proxy
curl 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:

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.