Plans & pricing
Codex CLI Cost: Billing, Credits, ChatGPT Plans, and API
Codex CLI cost breakdown: compare interactive ChatGPT subscription sign-in against per-token Developer API billing, evaluate prompt caching discounts, and model monthly developer spend.
Updated
In short
Running the Codex CLI costs whatever its sign-in bills. Signed in with ChatGPT, it draws on your plan's Codex allowance: OpenAI lists the CLI from ChatGPT Plus at $20 a month up, with Pro at $100, $200 or $500 and Business at $25 per user billed monthly. Signed in with an API key, every token goes to your OpenAI Platform account at standard API rates, which for an illustrative task comes to half a cent on GPT-6 Luna and 10 cents on GPT-6.1 Sol. Free and Go list Codex in the desktop app, not the CLI, so on those plans an API key is the listed route into the terminal.
On this page4
What each ChatGPT plan gives the CLI
Read the last column as the plan's terminal allowance. The price column is the whole bill unless you buy credits.
Plan | Price | Codex in the CLI on ChatGPT sign-in |
|---|---|---|
Free | $0 | Not listed; Codex runs in the desktop app on GPT-6 Luna, subject to rollout |
Go | $8 a month | Not listed; lightweight tasks in the desktop app |
Plus | $20 a month | Listed, for "a few focused coding sessions each week": an estimated 15 to 160 GPT-6.1 Sol or 350 to 3,000 GPT-6 Luna local messages per five hours |
Pro | $100, $200 or $500 a month | No five-hour limit at present |
Business | $25 per user monthly, or $20 billed annually, from 2 users | Standard Business has the same estimates as Plus |
OpenAI calls the estimates ranges, not fixed limits, and weekly limits may also apply. The CLI shares this allowance with ChatGPT Work, so heavy Work use leaves less for the terminal.
What one CLI task costs on an API key
An API key bills input, cached input and output tokens at different rates, so a task's cost depends mostly on how much of your repository the CLI reads. The table prices one illustrative task, 40,000 input tokens of code and context and 2,000 output tokens, at OpenAI's standard rates for the three models OpenAI lists for Codex on an API key. The task size is ours, not an OpenAI figure.
Model | Input / cached / output per 1M | No cache | 30,000 of the input tokens read from cache |
|---|---|---|---|
GPT-6 Luna | $0.10 / $0.01 / $0.50 | $0.004 + $0.001 = $0.005 | $0.0003 + $0.001 + $0.001 = $0.0023 |
GPT-6.1 Sol | $2 / $0.10 / $10 | $0.08 + $0.02 = $0.10 | $0.003 + $0.02 + $0.02 = $0.043 |
GPT-6 Sol | $2 / $0.20 / $10 | $0.08 + $0.02 = $0.10 | $0.006 + $0.02 + $0.02 = $0.046 |
The cached column is what later turns in a long session look like, when the same files are sent again. It assumes the other 10,000 input tokens bill at the normal input rate; the turn that first writes context into the cache pays 1.25 times the input rate for it. A prompt over 272,000 input tokens costs more: the whole request bills at twice the input and cache rates and 1.5 times the output rate.
At the uncached sizes, $20 covers 4,000 Luna tasks or 200 GPT-6.1 Sol tasks. Codex: ChatGPT login vs API key works through where that meets the Plus price.
Checking usage and capping spend
- On ChatGPT sign-in,
/statusin the CLI shows the limits you have left. Your spend is the plan price plus any credits you choose to buy on Plus or Pro; Codex credits vs API billing compares credits with switching to an API key at the limit. - On an API key, spend follows tokens. The model is the biggest lever: GPT-6 Luna costs a twentieth of GPT-6.1 Sol per input and output token. Keeping one session on the same files lets the cache work, and keeping prompts under 272,000 tokens avoids the higher rate.
- Before an unattended run, check the billing settings of the OpenAI Platform account behind the key. This page has not verified which spending controls OpenAI offers there.
- For a team, admins can set
forced_login_methodto"chatgpt"to require ChatGPT sign-in, or to"api"to require an API key such as the organization's.
Claude Code splits the bill the same way, with one difference
Anthropic's Claude Code is included in Claude's paid plans, Pro at $20 a month and Max from $100, and shares their usage limits. Heavy sessions can switch to pay-as-you-go API credits through a Console account, as Codex can switch to an API key. The difference is that Claude Max and Ultra include monthly API credits ($100 a month on Max, $200 on Ultra), while Codex usage on a ChatGPT plan does not pay for API-key turns. Codex CLI vs Claude Code CLI cost compares the two in detail.
Edited byRick Finch
Official sources
Editorial guidance grounded in official product sources.
FAQ
Common questions
Is Codex included in ChatGPT plans?
Yes. OpenAI's Codex pricing page says Codex is included across ChatGPT Free, Go, Plus, Pro, Business, and Enterprise, with different access levels and limits by plan.
How do ChatGPT plan limits affect Codex CLI cost?
When you sign in through ChatGPT, the relevant plan's Codex limits determine included use. Plus is positioned for focused weekly sessions, while Pro is positioned for longer, higher-intensity daily sessions.
What happens when Codex plan limits are reached?
Eligible users can purchase credits to continue after plan limits. Credit use depends on the models and features used, so review the live rate and usage dashboard rather than estimating from message count alone.
What changes when Codex CLI uses an API key?
Extra local tasks run with an API key are charged at standard API rates. That moves the work from ChatGPT plan capacity to a separate API-platform budget.
Next steps
Take the next buying step
- Tool profileCheck Codex pricingUse the pricing page next when you need the current plan matrix, credit behavior, Business access paths, Codex-only seat boundary, and API billing details.
- GuideCheck whether Codex is freeUse this if your immediate decision is whether a free or limited-access route is enough before upgrading to a paid plan or workspace route.