Codex cost calculator
OpenAI's Codex coding agent loops over your repo with GPT-5 under the hood. Model the loop — calls, tools, retries, context growth — and see cost per task, monthly spend, waste, and whether a cheaper model or provider would do the same job.
Switching from GPT-5 to DeepSeek-V4 Pro (reasoner) (DeepSeek, same frontier tier) cuts monthly spend by $1.3K — 70% — for this workload.
Where each task's cost goes
| Model | $/task | $/successful | Monthly | vs current |
|---|---|---|---|---|
CHEAPEST OpenAI · fast | $0.0508 | $0.0591 | $76.18 | cheapest |
| Groq · fast | $0.054 | $0.0627 | $80.94 | 1.1× |
| Gemini · fast | $0.0928 | $0.1079 | $139 | 1.8× |
| OpenRouter · mid | $0.1114 | $0.1296 | $167 | 2.2× |
| DeepSeek · mid | $0.1213 | $0.141 | $182 | 2.4× |
| OpenRouter · mid | $0.2264 | $0.2632 | $340 | 4.5× |
| OpenAI · mid | $0.2539 | $0.2953 | $381 | 5.0× |
| Gemini · mid | $0.3069 | $0.3569 | $460 | 6.0× |
| Together · mid | $0.3622 | $0.4211 | $543 | 7.1× |
| DeepSeek · frontier | $0.3756 | $0.4368 | $563 | 7.4× |
| Groq · mid | $0.6334 | $0.7365 | $950 | 12.5× |
| Anthropic · mid | $0.95 | $1.10 | $1.4K | 18.7× |
| Together · mid | $1.11 | $1.29 | $1.7K | 21.8× |
CURRENT OpenAI · frontier | $1.27 | $1.48 | $1.9K | 25.0× |
| Gemini · frontier | $1.27 | $1.48 | $1.9K | 25.0× |
| OpenAI · frontier | $1.92 | $2.24 | $2.9K | 37.9× |
| Anthropic · frontier | $2.85 | $3.31 | $4.3K | 56.1× |
| Anthropic · frontier | $4.75 | $5.52 | $7.1K | 93.5× |
Per-1M-token list prices; figures are estimates and exclude embeddings, fine-tuning, image/audio, and infrastructure. Rows marked verifystill need a final check against the provider's live pricing. LLM prices change often.
Frequently asked questions
How much does OpenAI Codex cost?+
Codex bills as GPT-5 token usage. The driver is the agent loop: each turn re-sends the accumulated context, so cost scales with turns × average context size, not just task count. The calculator estimates per-task and monthly spend from your loop length, tool output sizes, and retry rate.
GPT-5 vs GPT-5 mini for an agent — what's the cost difference?+
GPT-5 mini is roughly 5x cheaper on input and output than GPT-5, at a lower capability tier. For well-scoped agent steps the mini model can cut spend dramatically; for hard reasoning you'll want full GPT-5. The comparison table prices both against your exact workflow.
Does OpenAI prompt caching reduce Codex costs?+
OpenAI applies automatic prompt caching to repeated prefixes, billing cached input at a fraction of the normal rate. As long as your system prompt and tool schemas stay byte-stable across turns, that large prefix is discounted. Toggle caching in the calculator to see the effect.
Is Codex cheaper than Claude Code?+
It depends on the workload and which models you compare. Pick the coding preset, then switch the model between GPT-5 and Claude Opus 4.8 / Sonnet 4.6 — the monthly-spend column updates instantly so you can compare like-for-like.