Codex has two pricing models, and almost every answer to “How much does Codex cost?” gives only one. With a ChatGPT subscription, Codex is included in a fixed monthly plan, with usage limits set by OpenAI. With an API key, you pay per token—input, cached input, and output—with no subscription: on Kunavo, GPT-5.6 Sol, the model we recommend by default for Codex, costs $2.00 per million input tokens, $0.20 for cached input, and $12.00 for output, and a real 20-step task costs about $0.62 ($1.29 without caching). The cheaper option comes down to one division: plan price ÷ cost per task. Heavy interactive use every day favors a subscription; occasional or automated use favors the API.
This page does not copy OpenAI's plans—them changing would make a copy wrong the following week; current prices are on the ChatGPT pricing page. It does the calculation plan comparisons skip: per-token pricing, a real task itemized line by line, and the break-even point, which you can fill in using your plan price. Prices verified on October 3, 2026; Kunavo prices are read live from the model catalog.
Subscription or API key: the two options
| ChatGPT subscription | API key (pay per token) | |
|---|---|---|
| Billing | Fixed monthly plan | Pay per token: input, cached input, output |
| Limits | Usage windows set by OpenAI | No usage windows; the limit is your balance and the cap you set for the key |
| A month without coding | Charged in full | $0 |
| A busy month | Can hit a limit and have to wait | Scales with the work—and so does the bill |
| Automation (CI, scripts) | Sign in with your ChatGPT account | One key per job, with its own spending cap |
The two options do not combine, but they can coexist: you can keep your subscription and switch to the key only on days when you hit the limit, by changing the model_provider in the config.toml.
Codex per-token pricing: suitable models
| Model | Use case | Kunavo per 1M (input / cached / output) | OpenAI public pricing (input / output) | Task of 20 steps |
|---|---|---|---|---|
| GPT-5.6 Sol | Default: most coding tasks | $2.00 / $0.20 / $12.00 | $5.00 / $30.00 promo $4.00 / $20.00 (at least through November 21, 2026) | $0.62 |
| GPT-6 Astra | Only the hardest ones — the bug that resists, the major refactor | $4.00 / $0.40 / $20.00 | $10.00 / $50.00 | $1.14 |
| GPT-5.6 Terra | Routine, well-defined steps and mechanical tasks: renaming, formatting, summarizing a diff | $0.70 / $0.07 / $4.20 | $2.00 / $12.00 | $0.22 |
Cached input is billed at 0.10× the input rate; cache writes cost 1.25× input on GPT-5.6 Sol/Terra and GPT-6 Astra. The OpenAI column comes from the same catalog, so you can check rather than take our word for it—on GPT-5.6 Sol, Kunavo is approximately 60% below the list price, and approximately 40% below the promotional rate OpenAI currently applies. Full model details: GPT-5.6 Sol on Kunavo.
A real task, itemized line by line
Codex is agentic: a request becomes many billable round trips with the model. The relevant unit is a step—reading context, proposing a change or running a command, and reporting back. Since the tool sends the context again at every step, a typical step uses about 25,000 input tokens and 1,200 output tokens. Most of the input repeats (instructions, files already read) and comes from the cache: we assume 20,000 cached tokens and 5,000 new ones, and count the new tokens as a cache write at 1.25×—the pessimistic case.
| Item (GPT-5.6 Sol) | Tokens per step | Rate per 1M | Cost per step |
|---|---|---|---|
| Input read from cache | 20,000 | $0.20 (0.10×) | $0.0040 |
| New input, written to cache | 5,000 | $2.50 (1.25×) | $0.013 |
| Output (including reasoning) | 1,200 | $12.00 | $0.014 |
| One step | — | — | $0.031 |
| 20-step task | ×20 | — | $0.62 |
| The same task without caching | ×20 | — | $1.29 |
| The same task at OpenAI public pricing, with caching | ×20 | — | $1.54 |
| The same task at OpenAI's current promotional pricing, with caching (at least through November 21, 2026) | ×20 | — | $1.14 |
To replace the assumption with your own figures, take the usage returned by the API—total input, cached input, output—and pass it to this function:
# Ce qu'a coûté une tâche Codex, à partir de l'usage renvoyé par l'API.
IN, OUT = 2.00, 12.00 # USD par 1M de tokens (gpt-5-6-sol chez Kunavo)
LECTURE, ECRITURE = 0.10, 1.25 # coefficients de cache sur le tarif d'input
def cout(input_total, en_cache, output, ecrit=0):
neuf = input_total - en_cache - ecrit
return (neuf * IN
+ en_cache * IN * LECTURE
+ ecrit * IN * ECRITURE
+ output * OUT) / 1_000_000 # output, raisonnement inclus
# 20 étapes : 500 000 d'input (400 000 en cache, 100 000 écrits), 24 000 d'output
print(round(cout(500_000, 400_000, 24_000, 100_000), 2))The break-even point—a division
The whole decision comes down to one line: plan price ÷ cost per task = number of tasks per month the subscription must replace to be worthwhile. Using the 20-step task on GPT-5.6 Sol:
| Monthly plan (example) | Break-even with caching ($0.62 per task) | Break-even without caching ($1.29 per task) |
|---|---|---|
| $20/month | ~32 tasks | ~16 tasks |
| $100/month | ~162 tasks | ~78 tasks |
| $200/month | ~324 tasks | ~155 tasks |
These are round-number examples to replace, not OpenAI pricing. The honest verdict depends on your usage pattern:
- Heavy interactive use every day: five tasks per workday comes to about 110 per month—$67.98 at the per-token rate on GPT-5.6 Sol. A plan priced below that costs less, provided its usage limits cover this volume.
- Occasional use: three heavy days in a month, with 15 tasks, cost $9.27. That's below the cost of any plan, and a month with no coding costs $0.
- Automation (CI, scripts, unattended agents): an API key is a natural fit—one per job, with a monthly spending cap per key (the API returns 402 once the cap is reached) and an IP allowlist, in
/app/keys.
One detail points the same way: the busy days when you subscribe are exactly the days you're likely to hit the limit—and hitting a limit means paid capacity you can't use. On the other hand, a plan is predictable and a per-token bill is not, which matters for a team budget.
Run Codex CLI with a pay-per-token API key
One constraint rules out most gateways: Codex CLI accepts only wire_api = "responses", so the endpoint must serve POST /v1/responses, not just chat completions. Kunavo serves both:
# ~/.codex/config.toml — Codex CLI sur une clé au token, sans abonnement.
model = "gpt-5-6-sol"
model_provider = "kunavo"
[model_providers.kunavo]
name = "Kunavo"
base_url = "https://api.kunavo.com/v1"
env_key = "KUNAVO_API_KEY" # le NOM de la variable, pas la clé
wire_api = "responses" # la seule valeur acceptée (et la valeur par défaut)export KUNAVO_API_KEY=sk-kn-... # à créer dans /app/keys
codex # modèle du config.toml (gpt-5-6-sol)
codex -m gpt-5-6-terra # tâche mécanique : le modèle le moins cher
codex -m gpt-6-astra # seulement si GPT-5.6 Sol n'a pas suffiThe key is never in the file: env_key is the name of an environment variable Codex reads at startup. Each field is explained in the Codex CLI integration documentation, and the complete setup, including the most common 401 and 404 errors, is covered in the Codex CLI API key guide (both in English).
What changes the actual cost
Reasoning tokens. GPT models think before answering, and that reasoning is billed as output even though it does not appear in the diff. Every additional 1,000 output tokens per step adds $0.012 on GPT-5.6 Sol, or $0.24 for a 20-step task. Go by the billed output in the usage, not the length of the response.
Caching. This is the biggest cost lever, more powerful than switching models: the same task costs $1.29 without caching and $0.62 with it. Sessions with stable context benefit the most. The OpenAI API pricing calculator has a field for this.
Long context. The GPT-5.6 family and GPT-6 Astra bill the ENTIRE request at 2× input / 1.5× output once the prompt exceeds 272,000 tokens. Starting a new session costs less than continuing one that has grown too large.
Model per step. The same 20-step task costs $0.22 on GPT-5.6 Terra, $0.62 on GPT-5.6 Sol, and $1.14 on GPT-6 Astra. Keep GPT-6 Astra for what GPT-5.6 Sol couldn't resolve.
Failures. Kunavo does not charge for failed requests. A retry that succeeds, however, is billed like any other call.
Paying from France
Token prices are in US dollars, and top-ups go through Stripe Checkout: cards (Visa, Mastercard, American Express), Apple Pay, Google Pay, and Link. SEPA Direct Debit is not currently offered; a debit card linked to your bank account normally works. Pay by Bank is not offered from France either: Kunavo Checkout displays it only to buyers in the United Kingdom, Ireland, and Finland, and Stripe opens it in France only in private preview (Stripe documentation on Pay by Bank, read on October 3, 2026).
This is a prepaid balance: minimum top-up $10, with no subscription, and the balance never expires. Large top-ups receive a bonus — $100 becomes $110.00 and $1,000 becomes $1,200.00. Based on the calculation above, $10 covers approximately 16 20-step tasks on GPT-5.6 Sol. Details are in the billing documentation.
Honestly: when Kunavo is not the right choice
The tradeoff compared with a direct call to OpenAI is shared capacity: there is no dedicated quota or contractual SLA. If you need guaranteed quota or an SLA by contract, go directly to OpenAI. And, as the calculation above shows, a subscription can cost less for heavy interactive Codex use every day. What the API key offers is everything else: no subscription, rates below public pricing, and one key for GPT and Claude.
Codex or Claude Code
These are two agentic CLIs billed per step: the calculation on this page applies to both; only the rate changes. Claude's side, using the same 25,000 / 1,200-token unit, is covered in Claude Code pricing, and the tools are compared in Claude Code vs Codex (in English). One Kunavo key works with both, making the choice an argument -m rather than a second account.
Frequently asked questions
How much does Codex cost?
Codex has two pricing options. With a ChatGPT subscription, it's included in a fixed monthly fee, with usage limits set by OpenAI (the current price is listed on the ChatGPT pricing page). With an API key, you pay per token, with no subscription: on Kunavo, GPT-5.6 Sol, the model recommended by default for Codex, costs $2.00 per million input tokens, $0.20 for cached input, and $12.00 for output, compared with $5.00 / $30.00 at OpenAI's public rate (OpenAI currently applies a promotional rate of $4.00 / $20.00, at least until November 21, 2026 according to its pricing page). A 20-step task (25,000 input tokens per step, 80% cached, 1,200 output tokens) costs about $0.62.
Is Codex free?
Codex CLI is free and open source, but the model behind it never is: each step is a billable call, whether deducted from a subscription quota or paid for with an API key. Whether ChatGPT's free plan includes Codex, and to what extent, is determined and changed by OpenAI — check its pricing page. The no-subscription option is a per-token API key: a month without coding costs $0.
What is OpenAI Codex's API pricing?
With the API, Codex CLI charges for the tokens used by the model you choose. On Kunavo, per 1M input / output tokens: GPT-5.6 Sol $2.00 / $12.00, GPT-6 Astra $4.00 / $20.00, and GPT-5.6 Terra $0.70 / $4.20. Cached input costs 0.10× the input price, and cache writes cost 1.25× the input price for these four models.
ChatGPT plan or API: which is better value for Codex?
Divide the plan price by the cost of one task: the result is how many tasks per month the plan needs to replace to be worthwhile. For a 20-step task costing $0.62 on GPT-5.6 Sol, a $20 plan breaks even at about 32 tasks, and a $100 plan at about 162 (example amounts, not OpenAI's price list). Heavy interactive use every day exceeds these figures, so the plan tends to win as long as its limits can handle it. Bursty or automated use stays below them, so the API wins.
How much does a Codex task cost?
It depends on the number of steps, not the hours. A typical step contains about 25,000 input tokens because Codex resends the context on every call, and 1,200 output tokens. On GPT-5.6 Sol through Kunavo, with 20,000 of those tokens read from the cache, one step costs $0.031 and a 20-step task costs $0.62; without caching, the same task costs $1.29. Reasoning tokens are billed as output without appearing in the response: rely on actual usage.
How can I pay from France? Is SEPA Direct Debit accepted?
SEPA Direct Debit is not currently offered. Stripe Checkout accepts cards (Visa, Mastercard, American Express), Apple Pay, Google Pay, and Link; a debit card linked to your bank account normally works. This is a prepaid balance starting at $10, which never expires, and failed requests are not charged.
Which model should I choose in Codex to spend less?
Adapt the model to the step. GPT-5.6 Sol is the default choice for coding tasks; GPT-5.6 Terra ($0.70 / $4.20) handles routine steps and mechanical tasks for a fraction of the cost; GPT-6 Astra ($4.00 / $20.00) pays off only where GPT-5.6 Sol was not enough. A weak model that needs three tries costs more than a strong model that succeeds on the first attempt.
Does Codex CLI work with another provider's API key?
Yes, via a [model_providers] block in ~/.codex/config.toml—but only with the Responses API: Codex accepts only wire_api = "responses", so the provider must serve POST /v1/responses. A gateway that only offers /v1/chat/completions cannot run Codex. Kunavo serves /v1/responses, with the base_url https://api.kunavo.com/v1.