Claude Code vs OpenAI Codex: which coding agent actually costs less in 2026?
Claude charges twice as much per token. So Codex should win on cost. It doesn't -- because Codex charges a container fee on every cloud task, and at typical task sizes that fee costs more than the tokens themselves. We ran the numbers across four usage tiers.

Photo by Artur Shamsutdinov on Unsplash
The short version
Codex charges a $0.12 container fee per cloud task on top of tokens. At a typical 2K-token task, that fee is 24x the token cost -- which is why Claude Code ends up cheaper even though its per-token rate is higher. At 10 tasks/day, Claude Code via API runs $2.86/month versus $27.50 for Codex. At 100 tasks/day, the gap narrows but Claude Code still lands $183 lower per month.
Both have $100/month plans with different limit structures. Codex's April 17 update added real computer use and 90+ integrations, making it a serious option for agents that interact with external tools and GUIs -- an area where cost alone does not decide the question.
What changed on April 17
The Codex desktop app was already a capable coding assistant. The April 17 update turned it into an OS-level agent. It can now click, launch, and type in any macOS app in the background -- your screen stays free while Codex works. A built-in browser lets agents annotate DOM elements directly. GPT-image-1.5 image generation is built in. Heartbeat Automations let you schedule tasks that fire on their own without you being present.
That last one matters. Scheduled background agents were the main thing Claude Code Routines had that Codex didn't. As of April 17, Codex has them too.
90+ plugins ship with the update: CircleCI, GitLab, Microsoft Suite, Slack, Gmail, Google Calendar, Notion, and more. Peter Steinberger -- the developer who built OpenClaw -- joined OpenAI in February specifically to lead personal agent strategy, and this update looks like his first major output.
Chronicle (shipped April 20) adds screen-recording-based memory for Pro subscribers on macOS. The agent builds a personal knowledge base from your actual work sessions. It's opt-in and has no equivalent in Claude Code right now.
The container fee that changes the math
When you run Codex cloud tasks via the API, every session starts a compute container. OpenAI began charging for this on March 31, 2026. A 4GB container costs $0.12 per 20-minute session, billed at the full rate regardless of how long the task actually takes.
At a typical short task -- 2,000 tokens total -- the codex-mini-latest token cost is around $0.005. The container is $0.12. The container costs 24x the tokens.
| Container size | Cost per task | Hourly rate |
|---|---|---|
| 1 GB | $0.03 | $0.09/hr |
| 4 GB (typical) | $0.12 | $0.36/hr |
| 16 GB | $0.48 | $1.44/hr |
| 64 GB | $1.92 | $5.76/hr |
Claude Code has no container fee. Token billing only. This is the number that makes the per-token comparison misleading if you stop there.
API costs across four usage tiers
These numbers use codex-mini-latest at $1.50/M input, $6.00/M output plus a $0.12 container fee per task, and Claude Sonnet 4.6 at $3.00/M input, $15.00/M output with no container fee. 22 working days per month.
| Scenario | Codex API / month | Claude Code API / month | Difference |
|---|---|---|---|
| Light10 tasks/day, 2K tokens avg | $27.50 | $2.86 | Codex costs $24.64 more |
| Medium50 tasks/day, 5K tokens avg | $147 | $37 | 75% of Codex spend saved |
| Heavy100 tasks/day, 10K tokens avg | $328 | $145 | Claude is 2x cheaper |
| Scale200 tasks/day, 15K tokens avg | $686 | $356 | $330 less with Claude |
Codex: codex-mini-latest rate card, $1.50/$6.00 per MTok + $0.12/task container fee (4GB). Claude: Sonnet 4.6 at $3.00/$15.00 per MTok, no container fee.
The gap closes as task size grows. Container fees are a fixed per-task cost, so their share of total spend shrinks when tasks use more tokens. For very large sessions -- long context analysis, full-codebase refactors -- the token costs eventually dominate and Codex's lower per-token rate starts to count. But for the short-to-medium tasks that make up most coding agent work, Claude Code wins on cost.
One caveat: these numbers use Sonnet 4.6. Switching to Opus 4.7 ($5/$25) pushes Claude Code to roughly $58 at medium use and $225 at heavy use -- still cheaper than Codex at those tiers, but the gap narrows.
Both cost $100/month -- but the limits work differently
OpenAI launched the ChatGPT Pro $100 plan on April 9, 2026, directly competing with Claude Max 5x. They are not really equivalent products.
| Plan | Price | Usage limits | Automation |
|---|---|---|---|
| ChatGPT Pro $100 | $100/mo | 100-600 cloud tasks / 5-hr window; 200-1,000 GPT-5.4 local msgs (2x promo active through May 31) | Heartbeat Automations |
| Claude Max 5x | $100/mo | 5x Pro token pool; token limits not published | 15 Routines/day |
| ChatGPT Pro $200 | $200/mo | 200-1,200 cloud tasks / 5-hr window; 400-2,000 GPT-5.4 local msgs; exclusive Codex Spark model | Heartbeat Automations |
| Claude Max 20x | $200/mo | 20x Pro token pool | 15 Routines/day |
Codex uses a 5-hour rolling window. Hit 600 cloud tasks in a burst and you wait for the window to reset. Claude Max uses a daily token pool -- once it's gone, it's gone until midnight. Neither is great for power users; they are just annoying in different ways.
Important: the ChatGPT Pro $100 plan launched with a 2x usage boost promo running through May 31. The limits in the table reflect that promo. After May 31 the cloud task cap drops to 50-300 per 5-hour window. If you're evaluating the $100 tier now, the limits change on June 1.
Where each tool actually wins
Codex is the better choice when you need agents that interact with external tools or GUIs. An agent that reads a failing CircleCI build, pulls the related GitLab issue, writes a fix, opens a PR, and posts the result to Slack -- that workflow is built in for Codex now, not something you wire up manually via MCP connectors. The macOS computer use also works differently: Codex runs in the background without taking over your screen, which Claude Code's computer use currently doesn't offer.
On code quality, Claude leads. Opus 4.7 resolves 64.3% of SWE-bench Pro tasks against GPT-5.4's implied 53-55% range. On GDPVal-AA (knowledge work), Opus 4.7 scores 1753 Elo against GPT-5.4's 1674. The gap shows up consistently: Anthropic's models do better at code review depth, and Claude Code's terminal-first interface still suits developers who want precise control over what the agent does.
GPT-5.4 outperforms on agentic search (89.3% vs 79.3%) and multilingual tasks. If your codebase has extensive documentation in multiple languages or your agents need to search external sources heavily, Codex has a real advantage here.
One thing harder to put in a table: the March 8 controversy. An AMD AI director filed a GitHub issue with 6,852 session logs showing Claude's reasoning depth dropped 67% around that date. Anthropic hasn't publicly confirmed what changed. The issue gathered significant developer attention, and we covered the data in our analysis of the regression. Quality metrics for coding agents are harder to track than prices, and this one is still unresolved.
Which one to pick
Use Claude Code if you run coding tasks via the API and cost is a real factor. The container fee is a structural disadvantage for Codex at most usage levels. Prompt caching cuts Claude Code costs further on sessions with large repeated context -- system prompts, repo structure, style guides.
Use Codex if your agents need to interact with external tools, GUIs, or your macOS desktop. The April 17 update added real integrations that would take weeks to wire up manually. Background computer use without screen takeover is something Claude Code doesn't currently match.
On subscriptions, both $100 plans work for a developer doing heavy daily coding work. We'd lean toward Claude Max for automation-heavy workflows using the API, Codex Pro for desktop agent tasks that need OS-level access and plugin integrations. And if you're testing Codex Pro in May, the promo limits expire June 1.
Sources
- OpenAI drastically updates Codex desktop app (April 16, 2026) - VentureBeat
- OpenAI introduces ChatGPT Pro $100 tier (April 9, 2026) - VentureBeat
- Anthropic releases Claude Opus 4.7 (April 16, 2026) - VentureBeat
- OpenAI Codex rate card - OpenAI Help Center
- Codex flexible pricing for teams (April 2, 2026) - OpenAI
- Claude API pricing - Anthropic
- Is Anthropic nerfing Claude? (April 13, 2026) - VentureBeat