Jump straight to the numbers

← All articles

$0.1325 for a focused Codex run: a sample receipt

01 / A 13.25-cent receipt, not a pricing promise

A cheap Codex session starts with a small job and ends when that job passes its checks. The expensive alternative is an open-ended conversation that keeps collecting files, logs, failed approaches, and unrelated improvements.

Here is a worked receipt for a focused run. Every rate and token count below is hypothetical, chosen to make the arithmetic inspectable. These are not current CheapRelay prices, measured Codex results, or a promise that your task will cost this amount. Check the selected model’s actual rates before budgeting.

  • ■ Uncached input: 25,000 tokens at $2 per million = $0.0500.
  • ■ Cache reads: 50,000 tokens at $0.20 per million = $0.0100.
  • ■ Cache writes: 5,000 tokens at $2.50 per million = $0.0125.
  • ■ Output: 6,000 tokens at $10 per million = $0.0600.
  • ■ Total: 86,000 billed tokens across the run, costing $0.1325.

The categories are separate, not overlapping. For this example, the cache-write rate is the complete charge for those write tokens, not an extra surcharge. Actual billing conventions can differ. Counts are cumulative across requests, not the size of one prompt. Output includes any reasoning tokens billed as output under the selected model’s rules.

02 / The wandering-session receipt reaches 41 cents

Now imagine a less disciplined attempt at the same narrow change. It scans unrelated directories, prints long logs, and continues into optional refactoring. Using the same hypothetical rates, its receipt looks like this:

  • ■ Uncached input: 100,000 tokens = $0.2000.
  • ■ Cache reads: 200,000 tokens = $0.0400.
  • ■ Cache writes: 20,000 tokens = $0.0500.
  • ■ Output: 12,000 tokens = $0.1200.
  • ■ Total: 332,000 billed tokens, costing $0.4100.

The difference is $0.2775 per run. Across 100 repetitions of these exact example receipts, that becomes $27.75. This is arithmetic, not evidence that shorter sessions always save that amount. A difficult bug may legitimately require more exploration, and an overly terse instruction can cause expensive rework.

03 / Give Codex one change and a stopping rule

Replace “clean up authentication” with a bounded request: “Fix the expired-token error in the refresh handler. Inspect the handler and its tests first. Add one regression test, run the targeted test command, and stop after reporting the patch and result. Do not refactor unrelated code.”

That instruction defines the defect, initial search area, proof of success, and exit. Ask for a brief plan only when the task needs one. For a small edit, a long planning exchange can become another billable artifact rather than useful work.

04 / Spend tokens on evidence, not terminal noise

  • ■ Search for symbols and filenames before requesting whole directories.
  • ■ Ask for relevant line ranges instead of repeatedly reading entire large files.
  • ■ Run the narrowest useful test first; expand coverage when the change warrants it.
  • ■ Keep successful command output short. On failure, inspect the relevant error and surrounding context.
  • ■ Request a compact completion report: changed files, tests run, remaining risks.

Do not hide failures just to shrink output. The goal is less irrelevant text, not less evidence. A concise failure report that leads to the correct fix is cheaper than a misleading success report followed by another session.

05 / Restart at task boundaries, not on a timer

A fresh session can discard accumulated distractions, but it also loses context and may require rereading files. It can change cache reuse, too. Restart after a completed task or a genuine scope change, not automatically every few minutes. Carry forward a short handoff describing the objective, current findings, changed files, and next check.

06 / Check the bill before repeating the workflow

CheapRelay works with Codex and bills per real token, including cache reads and writes, with no monthly fee or subscription. Compare recorded usage with the selected model’s current rates rather than treating cached input as free. Sign up for CheapRelay when you are ready to price a small, bounded Codex task.

Keep its receipt beside the test result. Your useful metric is cost per accepted change, including retries—not simply the lowest session total.

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

More reading

DateAisleWritten inTitle
2026-10-26Coding agents, cheaplyEN$0.0685 and $0.195: two shell-chore receipts
Two illustrative shell-task receipts show how input, output and cache charges add up in Gemini CLI and Claude Code.
2026-10-26Coding agents, cheaplyEN$2.28 for 100 Code Reviews: An Illustrative Receipt
A transparent token-cost receipt for 100 AI-assisted code reviews, with retry costs, spending limits, and a workflow that keeps context small.
2026-10-26Coding agents, cheaplyEN$1.50 a Day Just to Repeat Your Agent’s Memory
A token-by-token receipt for coding agent memory files, with hypothetical rates, cache math, and a practical way to measure the trade-off.
2026-10-26Coding agents, cheaplyEN$0.84 Saved by Clearing Unrelated Claude Code Tasks
A worked Claude Code token receipt: when /clear saves money, what /compact costs, and why cache billing can change the result.
2026-10-26Coding agents, cheaplyEN$13 of Usage, $7 of Headroom: A Tiny-Team AI Receipt
A three-developer coding assistant budget with token math, cache charges, shared configuration, and safeguards against surprise spending.
2026-10-26Coding agents, cheaplyEN$0.37 for an OpenCode Session: An Example Receipt
A worked OpenCode cost receipt: input, output, cache reads and writes, plus practical checks before using a pay-per-token backend.