Codestral is Mistral AI's language model with a 256K context window and up to 205K output tokens, available from 5 providers, starting at $0.2 / 1M input and $0.6 / 1M output. Mistral AI's dedicated code generation model supporting fill-in-the-middle, code correction, and agentic software engineering tasks.
Specifications
Canonical IDmistral-codestral
TypeLanguage
StatusDeprecated
CreatorMistral AIMistral AI
Providers
Context Window256K tokens
Max Output205K tokens
Input ModalitiesPDFText
Output ModalitiesText
Release Date · 1 year ago
Knowledge Cutoff · 2 years ago
Deprecation Date

Capabilities

Input2/5
Text✓
Image·
Audio·
Video·
PDF✓
Output1/5
Text✓
Image·
Audio·
Video·
Embedding·
Capabilities5/13
Reasoning·
Adaptive Reasoning·
Function Calling✓
Parallel Function Calling·
Structured Outputs✓
Native JSON Schema✓
Web Search·
URL Context·
Computer Use·
Code Execution·
File Search·
Prompt Caching✓
Assistant Prefill✓

Pricing by Provider

US Dollar ($)
Per 1M tokens
ProviderStandardBatch
Input
$ / 1M
Output
$ / 1M
Cache Read
$ / 1M
Input
$ / 1M
Output
$ / 1M
Cache Read
$ / 1M
Azure AI Foundry logo
Azure AI Foundry
mistral:codestral
$0.3$0.9N/A———
Google Vertex AI logo
Google Vertex AI
vertex_ai/codestral-2501
$0.2$0.6N/A———
Mistral AI logo
Mistral AI
codestral
$0.3$0.9$0.03$0.15$0.45N/A
OpenRouter logo
OpenRouter
mistralai/codestral-2508
$0.3$0.9$0.03N/AN/AN/A
OpenRouter logo
OpenRouter
mistralai/codestral-2508:batch
———$0.15$0.45$0.015
Vercel AI Gateway logo
Vercel AI Gateway
mistral/codestral
$0.3$0.9$0.03———

Cost Calculator

US Dollar ($)
Preset:

Versions

VersionReleasedContextInput / 1MOutput / 1MStatus
Codestral 2—128K$0.300$0.900Available
Codestral256K$0.200$0.600Current
Mamba Codestral 7B—256K$0.250$0.250Deprecated
Mamba Codestral 7B—256K$0.190$0.190Available

Model IDs

azure_ai/Codestral-2501
codestral-2405
codestral-2501
codestral-2508
codestral-latest
codestral/codestral-2405
codestral/codestral-latest
mistral-codestral
mistral/codestral
mistral/codestral-2405
mistral/codestral-2508
mistral/codestral-latest
mistralai/codestral-2508
openrouter/mistralai/codestral-2508
openrouter/mistralai/codestral-2508:batch
text-completion-codestral/codestral-2405
text-completion-codestral/codestral-latest
vercel_ai_gateway/mistral/codestral
vertex_ai/codestral-2501
vertex_ai/codestral@2405
vertex_ai/codestral@latest