aiapicostcalcUnit economicsPricesBrandsCompareBenchmarksSkills & PluginsFind my modelGuidesChanges

Codex CLI token cost: per task and per month

Short answer: OpenAI Codex CLI burns about 50K input tokens (65% cached) and 3,500 output tokens per typical task, so one task costs $0.0722 on Grok 4.7. At 150 tasks a month that is $10.84; without caching the same task would cost $0.1210. Evidence: documented.

Last verified 2026-11-18 · Sources: src/tools.json (OpenAI Codex CLI token basis, documented) and src/prices.json (rates) · Report an error

By Shangyi Duan · Tool token basis: Documented

Tool token data: src/tools.json (reviewed 2026-11-05) · Model rates: src/prices.json (checked 2026-11-18) · Evidence: Documented

Cost per task, three price points

One row per scenario from our tool data. The three price columns price the identical token counts on the cheapest, mid and premium reference models, so the difference is the model rate, not the workload.

ScenarioInput tokensCached inputOutput tokensCheapest current modelMid-tier reference modelPremium reference model
Light task
one short request with a small context and one or two tool calls
12K50%1,200$0.00126$0.0222$0.2520
Typical task
one coding or agent task with several tool calls and a medium context
50K65%3,500$0.00382$0.0722$0.7650
Heavy session
a multi-turn agent session with a large repo or long history; input counts all tokens re-sent across turns
200K75%10K$0.0115$0.2350$2.30

Rates: input $2 / cached $0.5 / output $6 per 1M on Grok 4.7. Prices checked 2026-11-18.

Monthly budget

Scenario at 150 tasks / monthCheapest current modelMid-tier reference modelPremium reference model
Light task$0.1890$3.33$37.80
Typical task$0.5737$10.84$115
Heavy session$1.72$35.25$345

At 150 tasks a month, one task at the typical size costs $0.0722 on Grok 4.7, so $100 covers about 1384 tasks. The same budget buys 131 tasks on the premium reference and 26144 on the cheapest one.

Recalculate this page in your browser

Server-rendered from the typical task on Grok 4.7 at 150 tasks a month. Change a field to recalculate; nothing is sent anywhere and the formula is the one under Method.

Cost per task
$0.0722
Cost per 1,000 tasks
$72.25
Monthly
$10.84

Where the tokens go

The provider basis behind these numbers

OpenAI documents Codex token rates in ChatGPT credits (GPT-6.1 Sol: 50 credits input, 2.5 cached input, 250 output per million tokens) and publishes local-message ranges per five-hour window (15-160 messages for GPT-6.1 Sol on Plus), explicitly saying larger projects and long sessions consume significantly more per message. The tiers assume task prompts plus AGENTS.md, tool definitions and file reads land around 50k input tokens for a typical task, with 50-75% of that prefix served from cache on later turns.

What caching is worth here

Our data does not assume a cached prefix for this tool (65% cached share), so the task price above is already the uncached input price. If the tool does repeat a stable prefix, adding it to the provider cache cuts the input side to $0.5 per 1M on Grok 4.7.

How to reduce it

Each tip changes a different part of the formula: caching changes the input rate, trimming history changes the input count, and routing simple steps to a cheaper model changes the rate for part of the work.

Sources and evidence

SourceRead onWhat it establishes
learn.chatgpt.com2026-11-04Codex/ChatGPT token credit rates, plan usage limits and local-message ranges per five-hour window.
learn.chatgpt.com2026-11-04Codex CLI surfaces (default model, /status context meter, subagents, MCP) that determine token consumption.

Evidence label: Documented

OpenAI documents Codex token rates in ChatGPT credits (GPT-6.1 Sol: 50 credits input, 2.5 cached input, 250 output per million tokens) and publishes local-message ranges per five-hour window (15-160 messages for GPT-6.1 Sol on Plus), explicitly saying larger projects and long sessions consume significantly more per message. The tiers assume task prompts plus AGENTS.md, tool definitions and file reads land around 50k input tokens for a typical task, with 50-75% of that prefix served from cache on later turns.

Method

The formula

Cost per task = (uncached input × input rate + cached input × cached rate + output × output rate) ÷ 1,000,000. Rates are the standard list prices in the price table (checked 2026-11-18); token counts come from src/tools.json (tool data reviewed 2026-11-05).

Why three reference models

The columns are the cheapest, median and most expensive current models by the cost of one typical agent task, named above so you can check each rate. They are a range, not a prediction of which model OpenAI Codex CLI uses.

What the monthly figure assumes

150 tasks a month (the tasks-per-month field in our tool data), the same count for every scenario, at the standard rate with no batch discount. A heavy session can count as several tasks, so replace the number with your own before you put it in a budget.

Official links

Related skills & plugins

Other entries in the AI coding agents category. Each name links to its token-cost page or its official site.

Related models

The three reference models in the cost table, with their full price tiers.

More

Related

Questions

How much does OpenAI Codex CLI cost per task?

One typical task costs $0.0722 on Grok 4.7, $0.00382 on the cheapest reference model (GPT-6 Luna) and $0.7650 on the premium reference (GPT-6 Cyber). The spread is the model rate: the token counts are identical in all three columns.

What does OpenAI Codex CLI cost per month at 150 tasks?

$10.84 a month on Grok 4.7 at the typical task size. Without the 65% cached input assumption it would be $18.15. Per 1,000 tasks the token bill is $72.25.

Why does OpenAI Codex CLI use so many input tokens?

Codex sends the model file contents, command output and its own tool calls, so repo exploration and test output dominate input tokens. The CLI shows a context-remaining meter, and long sessions or subagents multiply the billed input; thinking tokens are billed as output. The token shape is 50K input tokens (65% cached) against 3,500 output per typical task; input is resent every step, output is not.

Are the OpenAI Codex CLI token numbers measured or estimated?

The evidence label is "Documented". OpenAI documents Codex token rates in ChatGPT credits (GPT-6.1 Sol: 50 credits input, 2.5 cached input, 250 output per million tokens) and publishes local-message ranges per five-hour window (15-160 messages for GPT-6.1 Sol on Plus), explicitly saying larger projects and long sessions consume significantly more per message. The tiers assume task prompts plus AGENTS.md, tool definitions and file reads land around 50k input tokens for a typical task, with 50-75% of that prefix served from cache on later turns. Sources and read dates are in the table above; if a number is an estimate, the basis says what it assumes, and it is never described as a measurement.

Next step → See every tool cost side by side

Price data last checked 2026-11-18 against official sources · how we verify

Price-change alerts

One short email when a provider changes a price or a promo ends. No spam, unsubscribe any time.