Back to guides
Prices·September 11, 2026·Updated October 3, 2026·10 min read

Codex Costs — What a Real Task Costs Through the API, and When the Subscription Pays Off

One half of the calculation is the subscription fee; the other, which nobody opens up, is the token cost of a real task. Here are both, along with the division that decides between them.

Codex has two pricing options, and almost every answer to “What does Codex cost?” names only one. With a ChatGPT subscription, Codex is included in a fixed monthly fee, with usage limits set by OpenAI. With an API key, you pay per token — input, cached input, and output — with no base fee: on Kunavo, GPT-5.6 Sol the model we recommend as the default for Codex, costs $2,00 per 1M input tokens, $0,20 for cached input, and $12,00 for output, and a real 20-step task costs around $0,62 ($1,29 without cache). Choosing the cheaper option comes down to division: monthly fee ÷ cost per task. Heavy interactive users who work every day may be better off with the subscription; people who work in bursts or automate tasks may be better off with the API.

This page deliberately doesn’t reproduce OpenAI’s subscription tiers — they change, and a copied list becomes wrong within a week; see OpenAI’s ChatGPT pricing page for current details. Instead, it calculates what subscription comparisons leave out: the price per token, a real task itemized line by line, and the break-even point using your own subscription price. Rates checked on October 3, 2026; Kunavo prices are pulled live from the model catalog.

Subscription or API key: the two options

ChatGPT subscriptionAPI key (per token)
BillingFixed monthly feePer token: input, cached input, output
LimitsUsage windows set by OpenAINo window; limited by your balance and your own key limit
Quiet monthFull monthly price$0
Full monthMay hit a limit and have to waitRuns in the background — and so does the bill
Automation (CI, scripts)Your ChatGPT account loginOne key per job, with its own spending limit

The two options are billed separately, but they don’t have to be mutually exclusive: you can keep your subscription and use the key only on days when your limit is exhausted — via model_provider in config.toml.

Codex prices per token: models that work well for Codex

ModelUse caseKunavo per 1M (input / cached / output)OpenAI list price (input / output)20-step task
GPT-5.6 SolStandard: most coding tasks$2,00 / $0,20 / $12,00$5,00 / $30,00
Promotional price $4,00 / $20,00 (at least until November 21, 2026)
$0,62
GPT-6 AstraOnly the hardest ones — a stubborn bug or a major refactor$4,00 / $0,40 / $20,00$10,00 / $50,00$1,14
GPT-5.6 TerraRoutine steps with clear instructions and mechanical tasks: renaming, formatting, summarizing a diff$0,70 / $0,07 / $4,20$2,00 / $12,00$0,22

Cached input costs 0.10 times the input price; cache writes cost 1.25 times the input price for GPT-5.6 Sol/Terra and GPT-6 Astra. The OpenAI column comes from the same catalog, so you can verify the figures instead of taking our word for it — for GPT-5.6 Sol, Kunavo is around 60% below the list price, approximately 40% below the promotional price OpenAI currently charges. Full model details are on the GPT-5.6 Sol page.

A real task, itemized line by line

Codex is agentic: one prompt turns into many billed model calls. The unit that matters is the step — reading context, proposing a change or running a command, then reporting back. Since the tool resends context at every step, a typical step has about 25,000 input and 1,200 output tokens. Most of the input is repeated (instructions and files already read) and comes from the cache: we assume 20,000 cached tokens and 5,000 new tokens, counting the new tokens as a cache write at 1.25 times the rate — the pessimistic case.

Line item (GPT-5.6 Sol)Tokens per stepPrice per 1MCost per step
Input from cache20.000$0,20 (0,10×)$0,0040
New input written to cache5.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
Same task without cache×20—$1,29
Same task at OpenAI list price, with cache×20—$1,54
Same task at OpenAI’s current promotional price, with cache (at least until November 21, 2026)×20—$1,14

To replace the assumptions with your own figures, take usage from the API response — total input, cached input, and output — and enter them here:

codex_kosten.py
# Was eine Codex-Aufgabe gekostet hat, aus dem usage der API.
IN, OUT = 2.00, 12.00   # USD pro 1M Tokens (gpt-5-6-sol auf Kunavo)
LESEN, SCHREIBEN = 0.10, 1.25   # Cache-Faktoren auf den Input-Preis

def kosten(input_gesamt, gecacht, output, geschrieben=0):
    neu = input_gesamt - gecacht - geschrieben
    return (neu * IN
            + gecacht * IN * LESEN
            + geschrieben * IN * SCHREIBEN
            + output * OUT) / 1_000_000   # Output inkl. Reasoning

# 20 Schritte: 500.000 Input (400.000 gecacht, 100.000 geschrieben), 24.000 Output
print(round(kosten(500_000, 400_000, 24_000, 100_000), 2))

The break-even point—one division

That’s all you need to decide: monthly fee ÷ cost of one task = the number of tasks per month the subscription must replace to be worthwhile. Using the task above on GPT-5.6 Sol:

Monthly fee (example)Break-even with cache ($0,62 per task)Break-even without cache ($1,29 per task)
$20/month~32 tasks~16 tasks
$100/month~162 tasks~78 tasks
$200/month~324 tasks~155 tasks

The monthly amounts are round example figures for you to replace, not OpenAI's price list. The honest answer depends on your usage pattern:

  • Heavy interactive use every day: Five tasks per workday is about 110 per month — $67,98 at the GPT-5.6 Sol token rate. A subscription below this amount costs less, provided its usage limits can accommodate this volume.
  • In bursts: Three intense days a month with 15 tasks add up to $9,27. That's below any monthly fee, and a month without coding costs $0.
  • Automated (CI, scripts, unattended agents): A key is the natural fit — one per job, with a monthly spend limit per key (the API returns 402 when it's reached) and an IP allowlist, both available under /app/keys.

One detail points in the same direction: the heavy-use days you subscribe for are exactly the days you hit the limit — and a reached limit means paid capacity that isn't delivered. A monthly fee is predictable, while a token bill isn't, which matters for a team budget.

Running Codex CLI with an API key

One constraint rules out most gateways: Codex CLI only accepts wire_api = "responses", so the endpoint must provide POST /v1/responses, not just Chat Completions. Kunavo provides both:

~/.codex/config.toml
# ~/.codex/config.toml — Codex CLI mit einem Key pro Token statt Abo.
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"     # der NAME der Variablen, nicht der Key
wire_api = "responses"         # der einzige erlaubte Wert (und der Standard)
terminal
export KUNAVO_API_KEY=sk-kn-...   # anlegen unter /app/keys

codex                          # Modell aus config.toml (gpt-5-6-sol)
codex -m gpt-5-6-terra           # mechanische Aufgabe: das günstigste Modell
codex -m gpt-6-astra             # nur, wenn GPT-5.6 Sol nicht weiterkam

The key is never in the file: env_key is the name of an environment variable that Codex reads at startup. Each field is explained in the Codex CLI integration guide; the detailed setup, including common 401 and 404 errors, is in the Codex CLI API key guide (both in English).

What changes the actual bill

Reasoning tokens. GPT models think before they respond, and that reasoning is billed as output without appearing 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. Check the billed output in the usage, not the response length.

Cache. The biggest cost lever, bigger than switching models: the same task costs $1,29 without cache and $0,62 with cache. 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 charge the ENTIRE request at 2× the input price and 1.5× the output price above 272,000 prompt tokens. Starting a new session is cheaper than continuing one that has grown too large.

Model per step. The same 20-step task costs GPT-5.6 Terra on $0,22, GPT-5.6 Sol on $0,62, and GPT-6 Astra on $1,14. Use GPT-6 Astra for the cases GPT-5.6 Sol couldn't solve.

Failures. Failed requests aren't charged on Kunavo. A successful retry, however, is a normal billable call.

Paying from Germany

Token prices are in US dollars, and top-ups are made through Stripe Checkout: cards (Visa, Mastercard, American Express), Apple Pay, Google Pay, and Link. SEPA direct debit is currently not offered; a debit card linked to a current account works normally. Pay by Bank is also unavailable to buyers in Germany: it appears at checkout only for buyers in the United Kingdom, Ireland, and Finland, and for Germany Stripe still lists it as a private preview (as of: October 3, 2026).

It is prepaid credit: minimum top-up $10, no subscription, and the balance never expires. Larger top-ups receive a bonus—$100 becomes $110.00 and $1,000 becomes $1,200.00. Based on the calculation above, $10 is enough for approximately 16 20-step tasks on GPT-5.6 Sol. Details are in the billing documentation.

Honestly: when Kunavo isn't the right choice

The trade-off versus going directly to OpenAI is shared capacity: there is no dedicated quota or contractual SLA. If you need a guaranteed quota or an SLA by contract, go directly to OpenAI. And as the calculation above shows, anyone using Codex heavily and interactively every day may pay less with a subscription. What the key offers is everything else: no base fee, rates below list price, and one key for GPT and Claude.

Codex or Claude Code

Both are agentic CLIs billed per step, so the calculation on this page applies to both — only the rate changes. The Claude page using the same unit is at Claude pricing; the question of subscription limits is covered in Claude limits, and the tool comparison is in Claude Code vs Codex (in English). One Kunavo key gives you access to both, making the choice a -m argument instead of requiring a second account.

Frequently asked questions

What does Codex cost?

Codex has two pricing options. With a ChatGPT subscription, Codex is included in a fixed monthly fee, with usage limits set by OpenAI (see OpenAI’s pricing page for the current amount). With an API key, you pay per token with no base fee: on Kunavo, GPT-5.6 Sol, the recommended default model for Codex, costs $2,00 per 1M input tokens, $0,20 for cached input, and $12,00 for output, compared with $5,00 / $30,00 on OpenAI’s list (OpenAI currently charges a promotional price of $4,00 / $20,00, according to the pricing page at least until November 21, 2026). A 20-step task (25,000 input tokens per step, 80% cached, and 1,200 output tokens) costs around $0,62.

Is Codex free?

Codex CLI is free and open source, but the model behind it is never free: every step is a billed model call, whether it uses a subscription’s allowance or is paid for with an API key. OpenAI decides whether the free ChatGPT plan includes Codex and how much usage it provides, and that can change — OpenAI’s pricing page is the source of truth. The option with no base fee is the API key: a month with no coding costs $0.

How much does OpenAI Codex cost through the API?

Through the API, Codex CLI bills for tokens from 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 times the input price; cache writes cost 1.25 times the input price for these four models.

Is a ChatGPT subscription or the API better value for Codex?

Divide the monthly fee by the cost of one task: the result is the number of tasks per month the subscription must replace to be worthwhile. At $0,62 for a 20-step task on GPT-5.6 Sol, the break-even point is about 32 tasks for a $20 monthly fee, and about 162 for $100 (example amounts, not OpenAI’s price list). Heavy interactive users who work every day are above that point, so the subscription wins as long as its limits are enough. People who work in bursts or automate tasks are below it, so the API wins.

How much does a Codex task cost?

It depends on steps, not hours. A typical step has around 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 and do not appear in the response, so rely on usage, not response length.

Can I pay by SEPA direct debit from Germany?

No, SEPA direct debit is currently not offered. Stripe Checkout supports cards (Visa, Mastercard, American Express), Apple Pay, Google Pay, and Link; a debit card linked to a current account works normally. It is prepaid credit starting at $10, which never expires, and failed requests are not charged.

Which model keeps Codex costs low?

Choose the model that fits the step. GPT-5.6 Sol is the standard 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) is worthwhile only when GPT-5.6 Sol could not proceed. A weak model that needs three attempts costs more than a strong one that succeeds on the first try.

Can Codex CLI use another provider’s API key?

Yes, through a [model_providers] block in ~/.codex/config.toml — but only through the Responses API: Codex accepts only wire_api = "responses", so the provider must offer POST /v1/responses. A gateway that only offers /v1/chat/completions can’t run Codex. Kunavo offers /v1/responses, with the base_url https://api.kunavo.com/v1.