Codestral: Pricing, Context, and Benchmarks

Codestral is Mistral AI's Codestral model released on 2024-05-29. It runs on a 32K-token context window, priced at $0.20/M input and $0.60/M output. Code-specialized Mistral model. Cheap per token; popular for inline IDE assistance.

Input
$0.20/M
Output
$0.60/M
Context
32K
Max output
4K

Specifications

ProviderMistral AI
FamilyCodestral
Released2024-05-29
Statusactive
Context window32K tokens
Max output4K tokens
Modalitiestext
Capabilities function calling json mode streaming code
Tokenizermistral
API endpointhttps://api.mistral.ai/v1/chat/completions
DocumentationOfficial docs ↗
Last updated2026-05-29

Cost calculator

For 1,000 tokens of input and 1,000 tokens of output per call, this model costs $0.0008 per call. For typical usage:

WorkloadTokens / call (in/out)$/call$/1K calls$/1M calls
Short Q&A 200 / 100 $0.000100 $0.10 $100
Standard chat 1K / 500 $0.000500 $0.50 $500
RAG with retrieval 4K / 500 $0.001100 $1.10 $1,100
Long doc summary 20K / 1K $0.004600 $4.60 $4,600
Long context (100K input) 100K / 2K $0.020900 $20.90 $20,900

For more precise estimates including caching discounts, use the LLM API Cost Calculator.

Other Mistral AI models

Common comparisons

API setup

curl https://api.mistral.ai/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "codestral", "messages": [{"role": "user", "content": "Hello"}]}'

See the official documentation for the full request/response schema. For pre-flight token counting before paying, use the appropriate token counter.