CODESTRAL

Codestral: Mistral's specialized coding model

Built for code generation across 80+ programming languages. 256K context. $0.30/$0.90 per million tokens. A focused alternative to Claude Sonnet 4.6 for code-heavy workloads.

Try Codestral on Council See it in a council

Codestral is Mistral's purpose-built coding model. It's tuned exclusively on a code-heavy mix with strong coverage across 80+ programming languages — including Rust, Go, Swift, Kotlin, Solidity, and more obscure targets where general-purpose models sometimes stumble. The 256K context window is large enough to load a substantial slice of a codebase in a single call. Priced at $0.30 per million input tokens and $0.90 per million output, it's an order of magnitude cheaper than Claude Opus 4.7 for code work, and roughly 1/3 the cost of Claude Sonnet 4.6. The case for: high-throughput code generation, fill-in-the-middle (FIM) autocomplete, language coverage past JavaScript/Python/TypeScript, and pair-with-Claude councils where you want a code-specialist second opinion. The case against: SWE-bench refactor leadership still belongs to Claude Opus 4.7, and Codestral does not accept image input — no screenshot-to-code workflows.

Specs

ProviderMistral AI
SpecializationCode generation
Languages80+ programming languages
Context window256,000 tokens
MultimodalText only
Web searchNot enabled in Council
Price (in / out per 1M)$0.30 / $0.90

Best at

Where it loses

Codestral in a coding council

A solid coding council is Codestral + Claude Sonnet 4.6 + GPT-5.5. Codestral provides a code-specialist viewpoint at low cost, Sonnet 4.6 brings near-Opus quality at 1/5 the price, and GPT-5.5 contributes tool-calling stability if the workflow eventually needs to execute. The synthesizer reconciles disagreements, which is most valuable when one of the three has caught a bug the others missed.

Frequently asked questions

Is Codestral better than Claude Sonnet 4.6 for code?

On SWE-bench, no — Sonnet 4.6 (and Opus 4.7 above it) lead. But Codestral is materially cheaper, covers more niche languages, and is purpose-built for FIM. For high-volume code work where 90% quality at 1/3 the price is fine, Codestral wins.

How many languages does Codestral support?

80+ programming languages, including the major ones (Python, JavaScript, TypeScript, Java, C, C++, Go, Rust) and a long tail of niche targets like Solidity, Fortran, COBOL, and Elixir.

Can Codestral read images of code?

No — text only. For screenshot-to-code, use Mistral Large 3 or a Gemini variant in parallel.

What does FIM (fill-in-the-middle) mean?

A training objective where the model is given a code prefix and suffix and asked to generate the middle. It's the right setup for autocomplete and IDE integrations, and Codestral was trained on it explicitly.

How much does Codestral cost?

$0.30 per million input tokens and $0.90 per million output. Council AI bundles it inside monthly plan budgets.

Should I use Codestral for non-code tasks?

No — pick Mistral Small 4 or Medium 3.5 for general work. Codestral's tuning trades general-purpose quality for code specialization.