# 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.

- Page: https://models.litellm.ai/models/codestral
- Lab: Mistral AI
- LiteLLM model name: `mistral/codestral-2508`
- Context window: 128,000 tokens
- Max output: 128,000 tokens
- Added to LiteLLM: June 2024
- Prices updated: October 10, 2026

## Pricing by provider

Token prices in USD per 1M tokens.

| Provider | Model name | Input | Output | Cache read | Per image | Per second | Context |
|---|---|---|---|---|---|---|---|
| Mistral AI (snapshot 2508) | `mistral/codestral-2508` | $0.30 | $0.90 | $0.03 | – | – | 128K |
| Mistral AI (latest alias) | `mistral/codestral-latest` | $0.30 | $0.90 | $0.03 | – | – | 128K |
| Azure AI Foundry (snapshot 2501) | `azure_ai/Codestral-2501` | $0.30 | $0.90 | – | – | – | 256K |
| Codestral (snapshot 2405) | `codestral/codestral-2405` | $0 | $0 | – | – | – | 32K |
| Codestral (latest alias) | `codestral/codestral-latest` | $0 | $0 | – | – | – | 32K |
| Google Vertex AI (snapshot 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 Codestral (snapshot 2405) | `text-completion-codestral/codestral-2405` | $0 | $0 | – | – | – | 32K |
| Text Completion Codestral (latest alias) | `text-completion-codestral/codestral-latest` | $0 | $0 | – | – | – | 32K |
| Vercel AI Gateway | `vercel_ai_gateway/mistral/codestral` | $0.30 | $0.90 | – | – | – | 256K |

## Cost examples

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

## Features

Supported: Function calling, Structured output.

## Use it with LiteLLM

```python
from litellm import completion

response = completion(
    model="mistral/codestral-2508",
    messages=[{"role": "user", "content": "Hello!"}],
)
```

## 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.

Source: LiteLLM model price file, https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json
