When you look up Codex pricing, most pages lead to plan comparison tables. But in many cases, the number you actually need isn't there. There are two pricing models, and plan tables explain only one. This page gives you the actual cost of the other—pay-per-token pricing—so you can determine which is cheaper with one division.
In short, there are two ways to pay for Codex:
| Payment method | Billing unit | Usage limits |
|---|---|---|
| Included in a ChatGPT plan | Fixed monthly fee | Usage limits (stops when limits are reached) |
| API key (pay as you go) | Input and output tokens | No monthly fee or usage cap |
The two options don't stack. You can keep a plan and run Codex with a key, or vice versa.
Pay-per-token rates and the actual cost per step
Rates are read directly from the catalog (not entered manually, so this text updates automatically if prices change). GPT-5.6 Sol costs $2.00 / $12.00 per 1M tokens.
Rates alone don't give a clear picture, so here's the cost per task. Assuming one agentic step uses 25,000 input tokens and 1,200 output tokens (about the size of asking it to read code and make one change), one step costs about $0.0644. That works out to about 16 steps per $1. A task that takes about 20 steps costs about $1.288.
# 実際にいくらか確かめる最小のリクエスト。
# usage に返るトークン数 × 単価が、そのまま請求額になる。
curl -sS https://api.kunavo.com/v1/responses \
-H "Authorization: Bearer sk-kn-..." \
-H "content-type: application/json" \
-d '{"model":"gpt-5-6-sol",
"input":"このリポジトリのテストを一覧にして"}'The response's usage gives you the actual token counts, so you can determine the cost per task for your usage from that. Measure it instead of guessing.
The break-even point for a plan versus pay-per-token billing—one division
This is often debated, but the answer comes from calculation, not preference.
Monthly fee ÷ cost per task = break-even number of tasks. If a task costs about $1.288, the break-even point for a $20/month plan is around 16 tasks per month. Below that, pay-per-token billing is cheaper; above it, the plan is cheaper. No amount of comparing plan tables can replace this one-line calculation.
Plan prices and usage limits are subject to change. That's why this page doesn't reproduce plan prices: it follows the same approach as the English version of Codex pricing—it leaves out prices that change and gives you the calculation instead.
Finish the work today after hitting your limit
This is the most common problem with plan usage. According to OpenAI's help page, when you hit a limit you can add credits, apply an available reset, upgrade, or wait until the reset time. Eligible Plus and Pro users can buy credits without changing plans, and upgrading to an available higher-tier plan takes effect immediately and resets the billing cycle (Pro plan help). Upgrading changes your plan for the billing cycle, so if you only need extra capacity for that day, you can switch to a key just for that task. You don't need to cancel your plan.
# Codex CLI を従量課金のエンドポイントに向ける。
# Codex が受け付けるのは Responses API だけで、chat completions では動かない。
export OPENAI_BASE_URL=https://api.kunavo.com/v1
export OPENAI_API_KEY=sk-kn-...
codexThere's one important constraint here. Codex CLI accepts only the Responses API as a custom provider, and will not work with an endpoint that only provides chat completions. When choosing a provider, check for support for POST /v1/responses before looking at price. The setup steps for getting an API key are in Codex CLI API key setup.
Two ways to lower costs
First, choose models by task. You don't need to run auxiliary tasks like summarization, classification, and formatting on the top model. GPT-5.6 Terra costs $0.70 / $4.20 per 1M tokens, and switching these tasks to it barely changes the results.
Second, use prompt caching. If you repeatedly send the same context (repository descriptions, coding conventions), it can greatly reduce input costs. How it works and when it helps are explained in the prompt caching guide. If you're deciding between Codex and Claude Code, Codex and Claude Code compared compares their billing models (the English version is Claude Code vs Codex).
Frequently asked questions
How much does Codex cost?
There are two types of pricing, and they are often confused. One is included in a ChatGPT plan, which provides a usage allowance in exchange for a monthly fee. The other is token-based pay-as-you-go billing with an API key, with no monthly fee or usage limit. For pay-as-you-go, GPT-5.6 Sol through Kunavo costs $2.00 / $12.00 per 1M tokens. One agentic step with 25,000 input and 1,200 output tokens costs about $0.0644, or about 16 steps per $1.
Can I use Codex for free?
Some usage is free. Codex is included in ChatGPT's free plan and Go. OpenAI's pricing page says these plans offer GPT-6 Luna at standard speed in the desktop app (rolling out gradually). Codex CLI, IDE extensions, and the web version are listed starting with Plus. Other ways to use it require a paid plan's usage limits or token-based pay-as-you-go billing with an API key.
Which is cheaper: a plan or pay-per-token billing?
It comes down to one division. Monthly fee ÷ cost per task = break-even number of tasks. If one task is about 20 steps and costs about $1.288, a $20/month plan breaks even at around 16 tasks per month. Below that, pay-per-token billing is cheaper; above it, the plan is cheaper. Calculate it using your actual number of tasks—looking at plan tables won't give you the answer.
What should I do when I use up my Plus limits?
OpenAI's help page lists four options: add credits, apply an available reset, upgrade, or wait until the reset time. Eligible Plus and Pro users can buy credits without changing plans, and upgrading to an available higher-tier plan takes effect immediately (and resets the billing cycle). You can also keep your plan and switch to an API key just for that task. Set OPENAI_BASE_URL and OPENAI_API_KEY to use pay-per-token billing, then remove the variables to return to your plan.
Can Codex CLI use third-party endpoints?
It can use any endpoint that provides the Responses API (POST /v1/responses). This is the practical pitfall: Codex CLI will not work with a gateway that only provides chat completions. When considering a switch, first check whether the endpoint supports the Responses protocol.
What's the most effective way to reduce costs?
Move auxiliary tasks to a cheaper model. GPT-5.6 Terra costs $0.70 / $4.20 per 1M tokens, and tasks like summarization, classification, and formatting can be moved over without sacrificing accuracy. Prompt caching is the next most effective option: when you repeatedly send the same context, it can greatly reduce input costs.