Jump straight to the numbers

← All articles

Your First Week of Codex on $5 of Tokens

01 / Set a hard dollar limit before Codex opens the repo

Most people lose money on AI coding tools in the first ten minutes, not the first ten days. You start Codex with a vague goal, let it wander through a large directory, and only look at the numbers after the session has already burned through a pile of tokens. On a tiny budget that is the expensive order of operations. Flip it: decide the number first, then let the tool work inside it.

Take the simplest possible plan. You have five dollars of credit for an entire week. That is your ceiling, not your target. Before you type a single prompt, write down three things: the one task you want done, the maximum tokens you are willing to spend on it, and the exact moment you will stop. For example: fix the login form validation, allow up to 200,000 input tokens and 10,000 output tokens, and stop after the tests pass or after six turns, whichever comes first.

Turn counts matter more than they look. A long prompt is not paid for once. Every time you keep the conversation going, the whole context goes back to the model again. A 20,000 token conversation that runs for 25 turns can touch 500,000 input tokens before you count a single completion, and that is before cache writes and cache reads are added. CheapRelay bills per real token, including cache reads and writes, so those repeated turns are real line items on your receipt, not invisible overhead.

Put the cap somewhere you will actually see it: a comment at the top of your task notes, a number in the terminal title, a line in your notebook. The goal is to make spending visible before it happens rather than after.

02 / Shrink the context so every turn stays cheap

Token cost is mostly context, not cleverness. The model has to re-read whatever you hand it on each turn. If your prompt carries an entire monorepo, three log dumps, and a 400 line config file to make a one line change, you pay for all of it again on the next turn, and the turn after that.

  • ■ Point Codex at the smallest relevant directory. Do not open the repository root when the bug lives in one folder.
  • ■ Write a short AGENTS.md that names the build command, the test command, and the files the agent is allowed to touch. Two hundred words here can save thousands of tokens later.
  • ■ Paste the failing test and the specific error message, not the entire CI log. One hundred lines of relevant output beat two thousand lines of noise.
  • ■ Ask for answers in the shape you need. If you want a patch, ask for a patch only. Long explanations are billed like everything else.
  • ■ Start a fresh session when the task changes. Old context from an unrelated bug is dead weight you keep paying to re-send.

The arithmetic is worth doing once. Trimming a working context from 60,000 tokens to 12,000 tokens is a five-fold cut in what each turn re-sends. Across 20 turns that is 240,000 input tokens instead of 1,200,000. That difference is free to achieve; it costs only attention, and it dwarfs any clever model choice.

Short answers count too. Output tokens usually cost more per token than input tokens, and a model that writes five paragraphs where you needed four lines is quietly doubling your bill on every turn.

03 / Send routine edits to the cheap model and keep the heavy one for the hard parts

You do not need the largest model for every edit. Renaming a variable, adding a null check, writing a straightforward unit test, and fixing a typo in a docstring are mechanical tasks. Route those to a low-cost model on sale such as DeepSeek V4 Flash, and hold back a stronger model for architectural questions, subtle concurrency bugs, or anything where you have already watched two cheap attempts fail.

A practical split that works for beginners: start cheap, and only escalate after a failure. Ask the fast model first. If the test still fails after two focused attempts, stop and move the same short context to a stronger model rather than burning ten more cheap turns. Escalating once is usually far cheaper than retrying many times.

Keep in mind that CheapRelay prices models individually and those prices change over time, so check the current per-token rates before you plan a week. The rule does not depend on any particular rate: the cheapest session is the one where the right model sees the smallest useful context and is asked one clear question.

Codex and other clients work with the same OpenAI-compatible routes, so switching models between sessions is a configuration change, not a workflow change. Do that switch deliberately instead of leaving one model on for everything.

04 / End the session when the task ends, not when the chat feels finished

Short sessions are a discipline, not a technical setting. A session should have one job. When the job is done, stop, run the tests yourself, and read the diff. People commonly keep chatting after success just to ask for an explanation of what changed. Read the diff instead. It is free.

Watch for the three habits that quietly inflate bills. First, open-ended requests like clean this up or make it better, which invite the model to touch code you never intended to change and to write about it at length. Second, retry loops, where you paste the same error three times without changing anything in the prompt; give the model one new constraint each time or stop. Third, regenerating full files when only a few lines changed, which re-sends and re-writes far more than necessary.

Set a turn budget in your head, such as six turns for a bug fix and twelve for a small feature. When you hit it, close the session and reassess with fresh eyes. A second short session on a clean context is usually cheaper than the twentieth turn on a bloated one, because stale mistakes stop compounding.

05 / What five dollars looks like across seven days

Here is a sample weekly ledger to show the shape of a cheap practice week. These are token counts, not a benchmark or a price promise: your own numbers will differ, and current rates are listed on the pricing page.

  • ■ Day 1: one session, one bug fix, about 90,000 input tokens and 4,000 output tokens across five turns.
  • ■ Day 2: one session, one small refactor, about 140,000 input tokens and 7,000 output tokens across eight turns.
  • ■ Day 3: no session at all. Reading your own code costs nothing.
  • ■ Day 4: one short session to add a test, about 60,000 input tokens and 3,000 output tokens across three turns.
  • ■ Day 5: one session where you escalate to a stronger model halfway, about 180,000 input tokens and 9,000 output tokens across ten turns.
  • ■ Day 6: no session.
  • ■ Day 7: one short cleanup session, about 70,000 input tokens and 3,000 output tokens across four turns.

Add that up and the week is roughly 540,000 input tokens and 26,000 output tokens, split across five sessions instead of twenty. Because cache reads and cache writes count toward the total, the trimmed contexts matter as much as the raw turn counts. Put those totals next to the live per-token rates and you will know roughly where your five dollars goes before you spend it.

CheapRelay is built for exactly this pattern: pay-as-you-go billing per real token with no monthly fee and no subscription, one key across Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok and others, and working setups for Claude Code, Codex, Gemini CLI and any OpenAI SDK. If that matches the way you want to work, sign up at CheapRelay and start with a two dollar test key rather than a large deposit.

The habits are the real savings. Cap first, trim context, escalate only after failure, and close the session when the task is done. Do those four things and five dollars can stretch across a full week of real work instead of disappearing in an afternoon.

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

More reading

DateAisleWritten inTitle
2026-10-30Coding agents, cheaplyENOne Claude Code fix: $18.40 first, $2.13 second
Two Claude Code receipts judged on price per useful result, plus the two environment variables that changed the bill.
2026-10-30Coding agents, cheaplyENRunning Claude Code on $4.10 a Day Instead of $38
Two daily receipts, the same coding work, and a price-per-useful-result verdict. Real token math, no subscriptions.
2026-10-30Coding agents, cheaplyENThe $50 Coding Bill: 6 Habits That Quietly Double It
Six coding assistant habits that quietly double an AI bill, and a $5-a-month workflow that keeps token costs honest.
2026-10-30Coding agents, cheaplyENOne $5 Receipt Covers Claude, Codex and Gemini CLI
A beginner walkthrough for running Claude Code, Codex and Gemini CLI on one cheap relay key, with a $5 first-month cap and honest token math.
2026-10-30Coding agents, cheaplyEN$0.50 per pipeline run: the hard cap for CI agents
A beginner walkthrough for capping coding agent spend in CI: token math, hard stops and a $0.50 per run budget.
2026-10-30Coding agents, cheaplyENClaude Code on Windows: $0 Setup and a $10 First Receipt
Set up Claude Code on Windows with PowerShell environment variables, then meter every token with CheapRelay pay-as-you-go billing.