Mistral's Codestral and SpaceXAI's Grok Build 0.1 are both code-specialist models. Codestral is cheaper per token on paper, but Grok Build's cache-hit rate and larger context change the picture for agentic coding.
Codestral is cheaper on fresh tokens ($0.30/$0.90 vs $1.00/$2.00 per 1M). For agents that resend context, Grok Build's $0.20 cache hit nearly closes the gap — the coding-agent example above is almost a tie — and Grok Build accepts 256K tokens against Codestral's 128K.
| Codestral | Grok Build 0.1 | |
|---|---|---|
| Provider | Mistral | SpaceXAI |
| Tier | Specialist | Specialist |
| Input / 1M tokens | $0.30 | $1.00 |
| Output / 1M tokens | $0.90 | $2.00 |
| Cache hit / 1M | $0.03 | $0.20 |
| Cache write / 1M | — | — |
| Context window | 128K | 256K |
| Notes | Code generation | Code tasks; replaced Grok Code Fast 1; ≥200K tokens: $2/$4, cache $0.40 |
Codestral is 3.3× cheaper on input tokens ($0.30 vs $1.00 per 1M). Codestral is 2.2× cheaper on output tokens ($0.90 vs $2.00 per 1M).
| Workload | Codestral | Grok Build 0.1 | Difference |
|---|---|---|---|
| Support chatbot 10,000 conversations × (2,000 input + 400 output tokens) | $9.60 | $28.00 | Codestral saves $18.40 |
| Document Q&A 1,000 questions × (30,000 input + 800 output tokens) | $9.72 | $31.60 | Codestral saves $21.88 |
| Coding agent session 4M input tokens (90% cache hits) + 150,000 output tokens | $0.36 | $1.42 | Codestral saves $1.06 |
Standard rates per 1M tokens from data on this site. The coding-agent row assumes 90% of input is read from the prompt cache (full input price where a model has no cache rate). Cache-write fees, batch discounts and long-context surcharges listed in the notes are not included. Updated November 2, 2026.
you need fast, cheap code generation or completion with short context — IDE autocomplete, snippet generation, test scaffolding — where fresh tokens dominate.
you run multi-turn coding agents over large repositories, need more than 128K tokens of context, or were on Grok Code Fast 1, which it replaced.
Our table lists no cache-hit rate for Codestral, so every resent token pays the $0.30 input rate. Grok Build charges $0.20 per 1M on cache hits — cheaper than Codestral's full input price. In a session that is 90% cached input, Grok Build's higher output rate is roughly offset, leaving the two within about 7% of each other. With lower cache-hit rates, Codestral pulls ahead.
Codestral's 128K window can be tight for agents that load many files at once. Grok Build accepts up to 256K tokens but bills prompts of 200K or more at $2/$4 per 1M for the whole request, so keep agent context under 200K when you can.
Mistral's pricing page says batch processing halves prices, which suits offline jobs like bulk test generation or code migration on Codestral. For harder agentic tasks, compare general flagships too — see the best AI for coding guide.
On fresh input and output, yes. On cache-heavy agent sessions the two come out close, because Grok Build bills cache hits at $0.20 per 1M.
Codestral lists 128K tokens and Grok Build 0.1 256K.
It replaced Grok Code Fast 1 as SpaceXAI's code-focused model.
How we choose: prices come from each vendor's official pricing page and are re-checked every week. We take no affiliate fees, so rankings aren't for sale.