Codestral vs GPT-4o: Detailed Comparison
Choosing between Codestral (Mistral AI) and
GPT-4o (OpenAI) comes down to three things:
per-token pricing, context window, and which capability matters most for your workload.
Codestral costs $0.20/M input vs
$2.50/M for GPT-4o;
context windows are 32K vs
128K tokens. Detailed breakdown below.
Side-by-side specs
| Spec | Codestral | GPT-4o |
| Provider | Mistral AI | OpenAI |
| Released | 2024-05-29 | 2024-05-13 |
| Input price |
$0.20/M |
$2.50/M |
| Output price |
$0.60/M |
$10.00/M |
| Cached input |
— |
$1.2500/M |
| Context window |
32K |
128K |
| Max output |
4K |
16K |
| Modalities |
text |
text image audio |
| Tokenizer |
mistral |
o200k_base |
Capability matrix
| Capability | Codestral | GPT-4o |
| function calling |
Yes |
Yes |
| json mode |
Yes |
Yes |
| streaming |
Yes |
Yes |
| code |
Yes |
No |
| vision |
No |
Yes |
| audio |
No |
Yes |
Benchmark comparison
Higher is better for all benchmarks shown.
| Benchmark | Category | Codestral | GPT-4o | Δ |
| MMLU |
general |
— |
88.7 |
— |
| HumanEval |
coding |
— |
90.2 |
— |
| MMMU |
multimodal |
— |
69.1 |
— |
Per-call cost on typical workloads
| Workload (in/out tokens) | Codestral | GPT-4o | Cheaper by |
| Standard chat (1K / 500) |
$0.000500 |
$0.007500 |
Codestral by $0.007000 |
| RAG (4K / 500) |
$0.001100 |
$0.015000 |
Codestral by $0.013900 |
| Long doc (20K / 1K) |
$0.004600 |
$0.060000 |
Codestral by $0.055400 |
| Very long context (100K / 2K) |
$0.020900 |
$0.265000 |
Codestral by $0.244100 |
When to choose Codestral over GPT-4o
- Per-token input cost is 92% lower — meaningful for high-volume workloads.
- Supports code — GPT-4o does not.
When to choose GPT-4o over Codestral
- Larger context window (128K vs 32K).
- Supports vision — Codestral does not.
- Supports audio — Codestral does not.
Related comparisons