OpenAI Codex Pricing: Free Tier, API Costs, and How It Compares in 2026
In this article
- What does OpenAI Codex cost?
- Is there a free tier for Codex?
- OpenAI Codex (API) vs Claude Code vs Cursor: pricing comparison
- How much does Codex cost in practice?
- OpenAI API rate limits and usage tiers
- Codex CLI vs API: what's the difference?
- Who should use the OpenAI API for coding vs a flat-rate tool?
- Key takeaways
- Sources
OpenAI Codex is available through the OpenAI API, charged per token with no dedicated flat-rate subscription plan. There is no standalone "Codex Pro" tier. Developers access it via the code-davinci-002 or newer models through the standard OpenAI API pricing structure. If you're comparing it to Claude Code or Cursor, the cost model is fundamentally different: you pay per token, not per seat.
- API access: pay-as-you-go, per token
- No monthly flat-rate Codex plan (unlike Claude Code's $20/mo Pro or $100/mo Max)
- Free-tier OpenAI API credits available for new accounts ($5 trial credit)
What does OpenAI Codex cost?
Codex itself was a specialized model series from OpenAI, but as of 2023 OpenAI deprecated the standalone Codex models (code-davinci-002, code-cushman-001) in favor of GPT-4 and GPT-4o, which have equivalent or better code generation capabilities. According to OpenAI's API pricing page, the current coding-capable models are priced as follows:
| Model | Input (per 1M tokens) | Output (per 1M tokens) | Notes |
|---|---|---|---|
| GPT-4o | $2.50 | $10.00 | Best for complex code tasks |
| GPT-4o mini | $0.15 | $0.60 | Good for lighter coding tasks |
| o3 (reasoning) | $10.00 | $40.00 | High-accuracy, slower |
| o4-mini | $1.10 | $4.40 | Budget reasoning model |
The original Codex models were actually free during their research preview (2021-2022), which is why many developers still search for "Codex pricing" expecting a free tier. That free access ended when the models were deprecated. What replaces Codex today is the broader GPT-4 family, all billed at the token rates above.
Is there a free tier for Codex?
New OpenAI accounts receive a small amount of free API credits (typically $5) to trial the API. Beyond that, there is no ongoing free tier for production API use. OpenAI's platform documentation outlines the full access model: after trial credits expire, you add a payment method and pay per usage.
If you're looking for free coding AI access, the closest equivalents in 2026 are:
- GitHub Copilot Free: 2,000 code completions and 50 chat messages per month
- Claude Code: Available on Claude.ai Pro ($20/mo), with usage limits reset on a 5-hour rolling window
- Cursor Free tier: 2,000 completions per month, 50 slow premium requests
OpenAI Codex (API) vs Claude Code vs Cursor: pricing comparison
The pricing structures are fundamentally different across these tools, which makes direct comparison tricky. Here's a framework that helps:
| Tool | Pricing model | Entry cost | Heavy use cost | Usage limits |
|---|---|---|---|---|
| OpenAI API (GPT-4o) | Pay per token | $0 (trial credits) | Scales linearly | Rate limits by tier |
| Claude Code (Pro) | Flat monthly | $20/mo | $20/mo (capped) | 5-hour rolling window |
| Claude Code (Max) | Flat monthly | $100/mo | $100/mo (capped) | Higher 5-hour window |
| Cursor Pro | Flat monthly | $20/mo | $20/mo (500 fast requests) | 500 premium requests/mo |
| GitHub Copilot | Flat monthly | $10/mo individual | $10/mo | Soft limits on premium models |
For a deeper dive on the flat-rate side, see the Claude Code vs Cursor pricing comparison and Codex vs Claude Code breakdown.
How much does Codex cost in practice?
The token-based model means cost varies by how much context you send and how much output you generate. A rough estimate for typical developer usage:
- Short completions (autocomplete-style): ~500 tokens per request. At GPT-4o mini rates, that's $0.00008 per completion. Practically free.
- Multi-file refactor or code review: could be 10,000-50,000 tokens. At GPT-4o rates: $0.025-$0.125 per task.
- Agentic coding session (long context, multiple iterations): could hit 200,000+ tokens. At GPT-4o: $0.50-$2.50 per session.
For heavy daily coding use, the token costs can add up faster than a flat $20/mo Claude Code Pro subscription. The break-even point is roughly 8M input tokens per month at GPT-4o rates, which most active developers will exceed.
OpenAI API rate limits and usage tiers
OpenAI uses a tiered rate limit system tied to how much you've spent. According to OpenAI's rate limits documentation:
| Usage tier | Requirement | GPT-4o RPM limit | TPM limit |
|---|---|---|---|
| Tier 1 | $5 paid | 500 RPM | 30,000 TPM |
| Tier 2 | $50 paid, 7 days | 5,000 RPM | 450,000 TPM |
| Tier 3 | $100 paid, 7 days | 5,000 RPM | 800,000 TPM |
| Tier 4 | $250 paid, 14 days | 10,000 RPM | 2,000,000 TPM |
| Tier 5 | $1,000 paid, 30 days | 10,000 RPM | 30,000,000 TPM |
New accounts start at Tier 1 with the most restrictive limits. This matters if you're building on top of the API: early-stage projects may hit rate limits before the spend thresholds naturally advance your tier.
Codex CLI vs API: what's the difference?
In 2025, OpenAI released Codex CLI, an open-source terminal agent built on top of the OpenAI API. It's free to install but uses your API credits when running. It's the closest analog to Claude Code as a terminal-native coding agent.
Key distinction: Codex CLI is the interface; OpenAI API is the billing layer. You still pay per token for every command you run through Codex CLI. There's no flat subscription that bundles CLI access plus model usage the way Claude Code's Pro/Max plans do.
If you're weighing the two, the Codex vs Claude Code comparison covers the workflow and cost differences in detail.
Who should use the OpenAI API for coding vs a flat-rate tool?
The token-based model works well when:
- You're building a product on top of the API (you can pass costs to customers)
- Your usage is light or unpredictable and a $20/mo subscription feels wasteful
- You need programmatic access and flexibility over model selection
A flat-rate tool like Claude Code or Cursor makes more sense when:
- You're a developer using it daily as a personal coding assistant
- You want predictable monthly costs with no surprise bills
- You prefer an integrated editor or CLI experience without managing API keys
For teams evaluating the Claude Code side of this, also see the Claude Code vs API cost comparison which breaks down when the flat subscription becomes cheaper than direct API calls.
Key takeaways
- The original Codex models are deprecated. Current OpenAI coding models are GPT-4o, GPT-4o mini, and the o-series.
- No flat-rate Codex plan exists. You pay per token via the OpenAI API.
- GPT-4o costs $2.50/1M input tokens and $10/1M output tokens as of 2026.
- New accounts get $5 in free API credits. There is no ongoing free tier.
- For heavy daily use, flat-rate tools like Claude Code Pro ($20/mo) or Cursor Pro ($20/mo) are typically cheaper than equivalent API usage.
- Codex CLI is open-source and free to install but still consumes API credits.
Sources
Never Get Locked Out Mid-Task Again
Never hit your usage limits unexpectedly. Usagebar lives in your menu bar and shows your 5-hour and weekly limits at a glance.
Get Usagebar$9 — one-time, lifetime updates