Grok Code vs Codestral

Performance benchmarks + pricing comparison — updated April 2026

Grok Code

xAI

xAI's coding-specialized model. Optimized for code generation, debugging, and software engineering tasks.

Input$1.50/M
Output$7.50/M
Context128K tokens
Best ForCode generation, debugging, software development workflows

Codestral

Mistral

Mistral's dedicated coding model. Open-weight and highly optimized for code generation and completion.

Input$0.300/M
Output$0.900/M
Context128K tokens
Best ForCode completion, code generation, IDE integration
Benchmark60/100

Cost Comparison by Scenario

Estimated cost per project with 30% cache hit rate. Actual costs may vary based on usage patterns.

ScenarioGrok CodeCodestralSavings
Small Script (1K lines) $0.28 $0.04 Codestral saves $0.24 (86%)
Medium Feature (10K lines) $2.02 $0.29 Codestral saves $1.74 (86%)
Large Project (50K lines) $10.13 $1.43 Codestral saves $8.70 (86%)
Code Review (5K lines) $0.45 $0.07 Codestral saves $0.37 (83%)

Verdict

Codestral wins on both price and performance — $0.300/M input with a benchmark score of N/A/100.

For most developers, this is the clear choice between these two models.

Compare with Other Models