Jump straight to the numbers

← All articles

Running Claude Code on $4.10 a Day Instead of $38

01 / Two receipts for the same kind of coding day

Receipt A is a Friday: 41 model calls over roughly nine hours of agentic coding, one stubborn test-suite bug, one small feature, and a total that reads $38.62. Receipt B is the following Friday: 44 calls, one refactor plus a similar feature, and a total that reads $4.10. Same tool, same habits, same developer. The gap is not a discount and not a benchmark result. It is arithmetic on two different rate cards, and the only metric that matters is the price you pay per useful result.

Most people judge an AI coding bill by the monthly total or by the sticker price of one model name. Both are bad instruments. A month hides the days where the agent churned through 40 failed tool calls and produced nothing you kept. A sticker price hides what happens after caching kicks in and after the agent decides to re-read a 600-line file eight times. The honest way to compare is to print the day, count the outcomes, and divide.

So here is the working definition for the rest of this article. A useful result is anything you would still have in your tree at the end of the day and would not want to rewrite by hand. A failing test that finally passes counts. A refactor whose diff you reviewed and merged counts. The four deleted drafts before it do not count. When you divide the daily total by the count of useful results, you get price per useful result, and that number is the one worth optimizing.

02 / What actually counts as a useful result

Before any pricing talk, decide what goes in the numerator. Otherwise a cheap day with nothing shipped looks better than an expensive day that fixed your release. Count results like these:

  • ■ A failing test suite turning green with a diff you accepted
  • ■ A merged refactor where the agent read, edited, and re-verified the same files
  • ■ A small feature that compiles and passes the checks you already had
  • ■ A documented explanation that saved you an hour of reading unfamiliar code

Do not count: abandoned attempts, repeated regenerations of the same file, tool loops that retried a broken command, or a long chat that ended in a rewrite. In the $38.62 day above, there were five useful results, which is $7.72 each. In the $4.10 day there were four, which is $1.03 each. Both days shipped real code. One of them cost seven times as much per thing kept, and the model was not the reason.

This framing also protects you from a common mistake: picking the cheapest model available and then spending six hours supervising it. Your time is part of the receipt even if the invoice does not show it. A model that finishes a task in nine calls at a higher rate can beat one that needs thirty calls at a lower rate, and only the price-per-result column will reveal it.

03 / Where the money actually goes inside a coding session

A Claude Code session is mostly rereads. The agent loads your project context, edits a file, runs a command, reads the output, and then reloads the context again on the next turn. If every one of those context loads is billed as fresh input, your bill is dominated by the same files being paid for over and over. Cache reads and cache writes are not a footnote here; for a long agentic session they are the majority of your token volume.

This is where a billing policy matters more than a model name. CheapRelay bills per real token, and that includes cache reads and cache writes, with no monthly fee and no subscription. In practice that means the tokens your session genuinely consumed are the tokens you pay for, at whatever price your rate card shows, and nothing accumulates while you sleep. There is no seat, no per-hour charge, and no plan you have to remember to downgrade in a quiet month.

The second leak is wasted turns. A command that fails because of a missing dependency gets retried. A file that was edited badly gets rewritten. Each retry is a fresh set of tokens, and the ratio of input to output in agent loops is heavily skewed toward input. Shaving output length saves almost nothing. Cutting the number of wasted turns saves a lot, which is why prompt discipline and tight project context matter more than most people expect.

04 / Working the daily arithmetic with your own rate card

Take one typical agentic day: 44 calls, roughly 320k cached input tokens across the session, 40k uncached input tokens, and 25k output tokens. If your blended rate lands at about $2.00 per million tokens across those categories, the day costs about $0.77. Multiply the volume three times for a heavier debugging day and you are still near $2.30. Push it to an extreme, multi-hour grind with aggressive context reloads and you might touch $5. The point is not those exact figures. The point is that once you are paying per real token with no fixed monthly charge, the day has a ceiling, and you can predict it before you start.

Contrast that with a fixed-fee arrangement. A flat monthly cost that feels safe in a busy month becomes expensive in a slow one, and it never shows you which of your habits is the expensive one. Per-token billing does. If you open the ledger after a bad day and see 400k tokens consumed by retried commands, you have a specific habit to fix. If you see a flat line you cannot inspect, you have nothing to act on.

One caution on the arithmetic: token pricing changes, and providers revise rate cards. The method above survives those changes. Write down your volume, apply the price currently shown on your account, and compute price per useful result. Any decision you make from that column will still be valid after the numbers move.

05 / Cheap models for the repetitive half of the day

Not every task needs your strongest model. Reading a file list, summarizing a stack trace, renaming variables across a directory, and drafting a commit message are cheap by nature. Hand those to a smaller model and reserve your expensive reasoning model for the design decisions and the hard debugging. Two models on sale at CheapRelay illustrate the split: Claude Haiku 4.5 is a sensible default for the mechanical half of the session, while Claude Sonnet 5 is the one you reach for when the fix needs to be right the first time.

Concrete habits that cut the daily total without slowing you down:

  • ■ Keep project context tight; a narrow set of relevant files beats a large repository dump
  • ■ Stop retrying the same broken command with the same prompt; fix the environment first
  • ■ Prefer many small edits with verification over one giant rewrite
  • ■ Set a per-task token budget and abandon a task when it passes that budget
  • ■ Batch mechanical work into the cheaper model and save the reasoning model for the hard 20 percent

Do these and the receipt gets shorter without the output getting worse. The $4.10 day was not a fluke; it was the same developer applying these habits with a rate card that charges only for tokens actually used.

06 / Making the monthly invoice boring

A boring invoice is one you can predict within a dollar or two, and prediction only comes from a per-token ledger you can read. Because CheapRelay is pay as you go with no monthly fee and no subscription, your spend is exactly your usage, and it stops the moment you stop. One API key reaches Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok and more, it works with Claude Code, Codex, Gemini CLI and any OpenAI SDK, and the API base is https://api.cheapapirelay.com with OpenAI-compatible routes under /v1 and Gemini native under /v1beta.

There is one more lever worth knowing about if you run this with a team or a study group: the referral program pays you 20 percent of what invited users pay. That is not a discount on your own rate card, and I will not pretend otherwise, but it does offset a meaningful slice of a shared bill once a few people are working the same way.

Set a daily target before you open the terminal. Decide what counts as a useful result for that day. Run the session. Close it out and divide the total by the count. If the number is under a dollar or two per result, keep going. If it is climbing, the fix is in your context and your retries, not in your model choice. Sign up at CheapRelay when you want to run the same experiment on a rate card that only charges for real tokens, and print two receipts of your own.

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, 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.
2026-10-30Coding agents, cheaplyENMy $0.40 Receipt After Pairing Cheap First
A beginner walkthrough: pair with a cheap model first, escalate only when stuck, and keep an evening receipt at $0.40.