Codex vs Claude Code: pricing, limits, and running both on one key
Codex and Claude Code compared on what they cost and how their limits work, from OpenAI's and Anthropic's own pages — and how to run either on any model with one API key.
Codex is OpenAI's coding agent; Claude Code is Anthropic's. Both run in the terminal and the IDE, and both come bundled with their maker's chat subscription. Which one writes better code for you is something to try for yourself. What each costs, and how its usage is rationed, is something we can lay out — from each vendor's own pages, as of November 4, 2026.
What they cost
| Codex | Claude Code | |
|---|---|---|
| Free tier | ChatGPT Free: quick coding tasks, GPT-6 Luna in the desktop app, subject to rollout | Not on Claude's Free plan |
| Entry plan | ChatGPT Go $8, Plus $20 a month | Claude Pro $20 a month ($17 billed annually) |
| Heavy-use plan | ChatGPT Pro from $100 a month ($100, $200 or $500) | Claude Max $100, Ultra $200 a month |
| On an API key | Billed at API pricing | Billed at API pricing |
Sources: OpenAI's Codex pricing and Anthropic's pricing page.
How the limits work
- Codex: ChatGPT and Codex share one allowance. On Plus, OpenAI publishes estimated messages per five-hour period, which vary with the model and the task; Pro plans currently have no five-hour limit.
- Claude Code: Pro and Max have a five-hour session limit and a weekly limit, shared with the Claude apps; verified Ultra accounts have no five-hour limit (Anthropic help).
In both cases the subscription is rationed in windows, and neither vendor publishes the allowance in tokens or dollars.
Running either on one key
Both agents take an API key, and both can run on more than their maker's models:
- Claude Code reads
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKEN— see Claude Code with any model. - Codex takes a custom provider in
config.toml— see Codex with any model.
Point both at one Inferray key and they draw from the same balance or Token Plan, on any of these models:
| Model | Input / 1M | Cached / 1M | Output / 1M | Context | Token Plans |
|---|---|---|---|---|---|
| GPT-6.1 Sol | $2 | $0.1 | $10 | 1.1M | Included |
| GPT-6 Luna | $0.1 | $0.01 | $0.5 | 1.1M | Included |
| Claude Opus 5.5 | $4 | $0.2 | $20 | 1M | Included |
| Claude Sonnet 5.5 | $2 | $0.1 | $10 | 1M | Included |
| Gemini 4 Argon | $4 | $0.2 | $20 | 1.0M | Included |
| Kimi K3 | $3 | $0.3 | $15 | 1.0M | Included |
A Token Plan's $20 buys $60 of usage a month across both agents, with no five-hour or weekly windows.
So which one?
Try both on your own repository — it costs little on an API key, and the cost calculator shows what a month of either would cost on the model you prefer. Many people end up using both: one key makes that a configuration change, not a second subscription.
Prices on this page come from the model catalog and were current on November 12, 2026.