Jump straight to the numbers

← All articles

$0.18 for a Codex Task, $0.62 for a Wandering Session

01 / A $0.18 receipt starts with a small assignment

A cheap Codex session is not necessarily the one with the fewest messages. It is the one that reads enough code to make the right change, verifies that change, and stops. A session that keeps exploring after the patch is finished can turn a small job into a surprisingly long receipt.

Here is a worked budgeting example, not a benchmark or a CheapRelay price quote. Assume illustrative rates of $2 per million uncached input tokens, $0.20 per million cached input tokens, and $10 per million output tokens. These figures are calculation inputs only; check your selected model’s current rates before setting a budget.

The assignment: fix one pagination bug, add a regression test, and report the result. Across all requests in this hypothetical session, the receipt is:

  • ■ Uncached input: 30,000 tokens × $2 / 1,000,000 = $0.06.
  • ■ Cached input reads: 100,000 tokens × $0.20 / 1,000,000 = $0.02.
  • ■ Output: 10,000 tokens × $10 / 1,000,000 = $0.10.
  • ■ Separate cache-write charges: $0 in this example, which assumes no additional write charge.
  • ■ Total illustrative charge: $0.18.

Those are cumulative billed tokens, not the size of one prompt. Repeated requests can process the same context repeatedly. Cache eligibility, billing categories, and additional output-related charges depend on the selected model and route; use the actual usage record when reconciling your bill.

02 / The wandering version adds $0.44 to the receipt

Now imagine the same task expanding into repository-wide exploration, unrelated cleanup, repeated test logs, and several explanations of an already finished patch. Under the same illustrative rates:

  • ■ Uncached input: 150,000 tokens = $0.30.
  • ■ Cached input reads: 600,000 tokens = $0.12.
  • ■ Output: 20,000 tokens = $0.20.
  • ■ Separate cache-write charges: $0 under the same assumption.
  • ■ Total illustrative charge: $0.62.

The difference is $0.44 per task. Across 100 tasks with exactly these assumed usage patterns, that is $44. This is arithmetic, not a promise that shorter sessions will produce those savings. A rushed session that needs three repair attempts can cost more than one careful pass.

03 / Give Codex a stopping rule before it reads files

Start with a bounded request: “Fix pagination when the final page is empty. Inspect the pagination handler and its tests first. Add one regression test. Do not refactor unrelated code. Run the relevant tests, then report changed files, test results, and any remaining uncertainty.”

That instruction defines the deliverable, initial search area, and finish line. It does not prevent necessary investigation. If the bug crosses another module, let the agent inspect it. The goal is fewer irrelevant tokens, not an artificial file limit that produces a bad patch.

04 / Trim repeated context before trimming useful verification

  • ■ Request targeted searches before full-file reads. Locate the handler, symbol, or failing assertion first.
  • ■ Keep tool output bounded. Ask for failure excerpts rather than repeatedly feeding complete successful logs back into context.
  • ■ Review the diff before broadening scope. Put optional cleanup into a separate task.
  • ■ After the patch passes its relevant checks, stop. Request one concise handoff instead of another narrative recap.

Do not skip tests merely to reduce tokens. Verification has a cost, but so does returning tomorrow to debug an unverified change.

05 / Reconcile real tokens, not session length

CheapRelay works with Codex and bills per real token, including cache reads and writes, with no monthly fee or subscription. That makes usage accounting more useful than counting chat turns. Sign up for CheapRelay when you are ready to measure a small, bounded task against its actual receipt.

Record the selected model, uncached input, cache reads, cache writes, output, and total charge. If a billing category carries a separate rate, include it explicitly. Keep sessions short by finishing defined work—not by deleting context that the next request immediately needs again.

Sign up Try the prices yourself, sign-up credit included.

More reading

DateAisleWritten inTitle
2026-10-27Coding agents, cheaplyENThe $5 Claude Code Setup Uses Two Environment Variables
Point Claude Code at CheapRelay with two variables, cap a tiny pay-as-you-go budget, and verify the first request without a subscription.
2026-10-27Coding agents, cheaplyEN$2 a Day for Claude Code: A Budget, Not a Promise
A beginner’s walkthrough for keeping Claude Code spending predictable with small tasks, token checks and a $2 daily planning limit.
2026-10-27Coding agents, cheaplyEN$1.00 for a $0.50 Coding Job
An illustrative coding-assistant receipt shows how repeated context, noisy logs, long answers and blind retries turn a $0.50 task into $1.00.
2026-10-27Coding agents, cheaplyEN$0.18 for a CI Agent Run, With a $0.50 Ceiling
A receipt-style CI agent budget: token costs, retry limits, request reservations, and a practical way to enforce a $0.50 run ceiling.
2026-10-27Coding agents, cheaplyENYour Input Bill: 90,000 Tokens From One File
A troubleshooting FAQ for coding agents: cut repeated files, noisy tool output and stale history without starving the agent of useful context.
2026-10-27Coding agents, cheaplyEN$0.192 for a coding session, not $0.480
A worked API receipt for cheap-first pair programming, with explicit assumptions, escalation limits, and a fair cost comparison.