Codestral vs GPT-5 Nano: Detailed Comparison

Choosing between Codestral (Mistral AI) and GPT-5 Nano (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 $0.05/M for GPT-5 Nano; context windows are 32K vs 400K tokens. Detailed breakdown below.

Side-by-side specs

SpecCodestralGPT-5 Nano
ProviderMistral AIOpenAI
Released2024-05-292025-08-07
Input price $0.20/M $0.05/M
Output price $0.60/M $0.40/M
Cached input $0.0050/M
Context window 32K 400K
Max output 4K 64K
Modalities text text
Tokenizer mistral o200k_base

Capability matrix

CapabilityCodestralGPT-5 Nano
function calling Yes Yes
json mode Yes Yes
streaming Yes Yes
code Yes No

Per-call cost on typical workloads

Workload (in/out tokens)CodestralGPT-5 NanoCheaper by
Standard chat (1K / 500) $0.000500 $0.000250 GPT-5 Nano by $0.000250
RAG (4K / 500) $0.001100 $0.000400 GPT-5 Nano by $0.000700
Long doc (20K / 1K) $0.004600 $0.001400 GPT-5 Nano by $0.003200
Very long context (100K / 2K) $0.020900 $0.005600 GPT-5 Nano by $0.015300

When to choose Codestral over GPT-5 Nano

  • Supports code — GPT-5 Nano does not.

When to choose GPT-5 Nano over Codestral

  • Per-token input cost is 75% lower than Codestral.
  • Larger context window (400K vs 32K).

Related comparisons