Codex Costs: API Billing vs Subscription Usage
Beginner guide to OpenAI Codex costs: ChatGPT Plus login vs API-key billing table, real per-prompt dollar math, and 3 steps to lock a monthly budget cap.
On this page

New Codex users almost always ask the same question first: "I already pay $20/month for ChatGPT Plus—will running Codex charge my credit card extra?"
The answer depends entirely on which sign-in button you picked when logging in.
Side-by-side comparison: which wallet are you actually spending from?
Codex supports two completely separate login paths with separate wallets (documented in OpenAI's authentication guide and official pricing and usage docs):
| Sign-In Path | Which Wallet Pays? | Can You Get a Surprise Bill? | What Happens When You Hit the Cap? | Best For |
|---|---|---|---|---|
| Option A: Sign in with ChatGPT | Included allowance inside your Plus / Pro / Team subscription | No (flat monthly subscription unless you manually buy extra credits) | Prompts pause until the cooldown window resets, or you top up credits | Beginners who want predictable flat monthly spending |
Option B: Enter an sk-... API Key | Prepaid dollar balance on platform.openai.com | Pay-per-token; heavy loops keep spending unless you set a monthly cap | Stops with a quota error once your prepaid balance hits $0 | Developers without a subscription or users avoiding cooldown caps |
Not sure which path your Codex CLI is using right now? Check in two seconds:
- Open your terminal and run
codex login status—it tells you immediately whether you are signed in viaChatGPTor anAPI key(no need to log out or delete keys just to check). - Inside an active Codex session, type
/statusand press Enter to see your current session and plan usage status.
If you use an API key: model rates and a real dollar example
When paying per token with an sk-... key, newer models cost far less than older ones. Compare older Codex models against the newly released GPT-6.2 Sol (prices in US dollars per 1 million tokens, roughly 750,000 English words):
| Model Name | Uncached Input | Cached Input Read | Output | Plain Beginner Advice |
|---|---|---|---|---|
| GPT-6.2 Sol (newest) | $2.00 | $0.10 | $10.00 | Switch here first: stronger coding at half the price of 5.6 Sol |
| GPT-5.6 Sol (older) | $4.00 | $0.40 | $20.00 | Common in older guides, yet costs 2x as much as 6.2 Sol |
| GPT-5.5 (legacy) | $5.00 | $0.50 | $30.00 | Expensive legacy rate; update older scripts to save money |
What does one small coding request actually cost?
Suppose one turn reads 10,000 uncached input tokens (a medium source file) and writes 2,000 output tokens:
- GPT-6.2 Sol:
0.01 × $2 + 0.002 × $10=$0.04(4 cents). - GPT-5.6 Sol:
0.01 × $4 + 0.002 × $20=$0.08(8 cents). - GPT-5.5:
0.01 × $5 + 0.002 × $30=$0.11(11 cents).
3 hidden reasons API bills grow faster than expected
Why do beginners sometimes send "just five messages" and see $2 spent on their API dashboard?
- One prompt triggers multiple background turns: When you ask Codex or DSH to "fix the failing test," the agent reads files, searches code, edits a file, runs tests, reads the error log, and edits again—billing input tokens on every step of that loop.
- Crossing 272,000 input tokens triggers a surcharge: Both 5.6 Sol and 6.2 Sol charge higher rates across the entire call whenever a single turn sends over 272,000 input tokens.
- Subscription Credits are not US dollars: Extra usage packs ("Credits") sold for ChatGPT subscriptions use their own deduction rules—1 credit is not
$1of API usage.
3-step beginner safety checklist to prevent overspending
Using an API key in Codex or inside DSH's OpenAI provider? Spend two minutes on these three steps before running big tasks:
Step 1: Set a hard monthly spending limit on OpenAI
Sign in to platform.openai.com, open Settings -> Limits (under Billing), set a low Monthly budget (such as $10 or $20), and leave Auto recharge turned off. Even if a coding loop gets stuck, billing stops automatically at your cap.
Step 2: Pick gpt-6.2-sol as your everyday model
Start Codex explicitly with codex --model gpt-6.2-sol so you do not accidentally burn flagship or legacy rates on routine edits (for structured task automation ideas, see DataCamp's Codex CLI workflow tutorial).
Step 3: Start a fresh chat after each finished fix (or run /compact)
Avoid keeping one giant conversation open all day. Starting a fresh session for each separate bug—or typing /compact when history grows long—stops you from re-sending tens of thousands of old tokens on every new reply.
Common questions
If I pay $20/month for ChatGPT Plus, are sk-... API keys free?
No. Pasting an sk-... API key always charges your separate pay-as-you-go developer balance on platform.openai.com. To use the allowance included in your Plus plan, choose Sign in with ChatGPT instead of entering an API key.
Does a 50% API price cut automatically double my ChatGPT Plus allowance?
Not necessarily. Subscription allowances and metered API prices follow separate product rules—check /status inside Codex or your ChatGPT usage settings to see your plan's actual remaining allowance.
Is the cheapest per-token model always the cheapest way to finish a task?
Only when it succeeds cleanly. If a tiny model fails four times in a row while gpt-6.2-sol fixes the bug on the first try, the smarter model often costs less overall (for background on earlier GPT-6 tiers, see our GPT-6 lineup guide).
Model and workflow guides
Gemini 4 Neon is here. When is it worth switching models?
Compare Gemini 4 Neon in two coding setups, work through a $0.45 API example, and find Neon in Gemini, Google AI Studio, and Antigravity.
Read →Models and costsGPT-6.2 Astra & Sol Guide: Specs, Pricing & Choice
Beginner guide to OpenAI's GPT-6.2 Astra and Sol: Claude vs DeepSeek price table, plain-English benchmarks, 272K cliff, and step-by-step DSH & Python setup.
Read →Models and costsGPT-6.1 Terra Guide: Uses, Pricing and Sol Comparison
Beginner guide to OpenAI's GPT-6.1 Terra: half-price visual, computer-use, and writing model compared with Sol and DeepSeek, plus DSH and Python setup steps.
Read →Model setup and costsConnect Local Qwen 3.8 27B to DSH
Beginner guide to connecting local Qwen 3.8 27B to DSH: GPU memory table, LM Studio / Ollama / llama.cpp port setup, exact 5-field config, and error fixes.
Read →Model setup and costsConnect Grok API to DSH: Setup & Tools
Step-by-step beginner guide to connecting xAI's Grok API (grok-4.7) to DSH: Grok vs Groq comparison, exact 5-field custom provider setup, and 401/404 fixes.
Read →Model setup and costsChoose a Gemini Model by Task and Cost
Beginner guide to Google Gemini model selection: compare 3.8 Flash, 4 Argon, and DeepSeek prices, watch 2027 rate changes, and set up DSH in 4 simple steps.
Read →Model benchmarks and engineeringGemini 4 Argon Coding Benchmarks & 1M Window
Beginner guide to Google's Gemini 4 Argon coding scores vs Claude and GPT, how its shared 1M window and 65K output cap work, plus 4-step DSH setup.
Read →API costs and enterprise ROIGemini 4 Argon API Pricing, Cache & ROI Guide
Beginner guide to Gemini 4 Argon API pricing: Dec 2026 2x rate jump, how 95% auto-caching and thinking tokens bill, DeepSeek cost comparison, and calculator.
Read →Model setup and costsClaude Sonnet vs Opus: Which Should You Use?
Beginner guide to Claude Sonnet 5.5 vs Opus 5.5: side-by-side API prices, per-prompt cost math, clear rules on when to upgrade, and 4-step DSH setup.
Read →Models and costsOpus 5.5 vs Fable 5.2: Which Model Is Right for You?
Beginner guide to Claude Opus 5.5 vs Fable 5.2: side-by-side API prices, coding benchmarks, per-task cost math, 30-day retention rules, and 4-step DSH setup.
Read →Content creationHow to draft a video script with Media Desk for DeepSeek Harness
Turn a phone note into a video script, cover, and storyboard with Media Desk for DeepSeek Harness. See how to install it, set up images, and export a draft.
Read →Mobile and remote accessUse DeepSeek Harness on Your Phone: Beginner Guide
Zero-jargon beginner guide to using DeepSeek Harness on your phone: find your computer IP, connect over home Wi-Fi in 2 minutes, or use Tailscale on 4G/5G.
Read →Model interfaces and workflowsMiniMax H3 vs M-Series in DSH: Which Works?
Beginner guide to MiniMax H3 vs M3 in DSH: why H3 is for video while M3 handles coding, how to avoid region 401 errors, and 4-step DSH setup instructions.
Read →API credentials and troubleshootingKimi API Key Errors: Region, Model and Permissions
Beginner fix guide for Kimi / Moonshot API key errors: match .ai vs .cn URLs, avoid retired model names and K3 Max typos, decode 401/404/429, and set up DSH.
Read →Image editing and toolsAI Image Editing: Prompts, Masks and Review
Beginner guide to AI image editing without ruining your subject: copy our 4-line prompt template, avoid PNG mask traps, inspect edges, and use DSH safely.
Read →