GPT-4o vs Codestral: Detailed Comparison

Choosing between GPT-4o (OpenAI) and Codestral (Mistral AI) comes down to three things: per-token pricing, context window, and which capability matters most for your workload. GPT-4o costs $2.50/M input vs $0.20/M for Codestral; context windows are 128K vs 32K tokens. Detailed breakdown below.

Side-by-side specs

SpecGPT-4oCodestral
ProviderOpenAIMistral AI
Released2024-05-132024-05-29
Input price $2.50/M $0.20/M
Output price $10.00/M $0.60/M
Cached input $1.2500/M
Context window 128K 32K
Max output 16K 4K
Modalities text image audio text
Tokenizer o200k_base mistral

Capability matrix

CapabilityGPT-4oCodestral
function calling Yes Yes
json mode Yes Yes
vision Yes No
streaming Yes Yes
audio Yes No
code No Yes

Benchmark comparison

Higher is better for all benchmarks shown.

BenchmarkCategoryGPT-4oCodestralΔ
MMLU general 88.7
HumanEval coding 90.2
MMMU multimodal 69.1

Per-call cost on typical workloads

Workload (in/out tokens)GPT-4oCodestralCheaper by
Standard chat (1K / 500) $0.007500 $0.000500 Codestral by $0.007000
RAG (4K / 500) $0.015000 $0.001100 Codestral by $0.013900
Long doc (20K / 1K) $0.060000 $0.004600 Codestral by $0.055400
Very long context (100K / 2K) $0.265000 $0.020900 Codestral by $0.244100

When to choose GPT-4o over Codestral

  • Larger context window (128K vs 32K) — relevant when whole documents or long histories must fit in a single call.
  • Supports vision — Codestral does not.
  • Supports audio — Codestral does not.

When to choose Codestral over GPT-4o

  • Per-token input cost is 92% lower than GPT-4o.
  • Supports code — GPT-4o does not.

Related comparisons