Jump straight to the numbers

← All articles

Two Receipts, 2 Million Tokens, $0.80 Saved

01 / Two receipts, 2 million tokens, and a $0.80 gap

Put two bills side by side and the model name does not decide the winner. The billing lines do. Receipt A and Receipt B below run the exact same job: 100 tool turns of an agent loop, 25 accepted results at the end, roughly 2 million tokens moved through the model in total. The prompt is the same. The output is the same. The answers are the same.

Receipt A totals $1.08. Receipt B totals $0.28. That is $0.80 of difference on one work cycle, and if the job runs 20 times a day, $16 a day, roughly $480 over a 30-day month of identical work. Nothing in the output quality explains the gap. The only thing that changed is which of the four token lines got charged and how often.

The four lines are input, output, cache write and cache read. Most bills that surprise people are not wrong. They are perfectly accurate reports of a prompt design that kept paying full price for context the model had already seen.

02 / What each of the four token lines is actually charging for

Every request to a model carries tokens in and tokens out. The bill splits the inbound side into three flavors depending on how the provider had to handle them.

  • ■ Input: fresh tokens the model has to read and the provider has to process for the first time. This is the baseline rate.
  • ■ Cache write: tokens being stored into a reusable prefix so later calls can reference them. In the usual pricing shape this sits slightly above the plain input rate, because the provider is paying to remember.
  • ■ Cache read: tokens served out of that stored prefix. This is the cheap line, typically a small fraction of the fresh input rate. It is the closest thing to a volume discount that does not require a contract.
  • ■ Output: tokens the model generates. This is the expensive line, commonly a multiple of input, and it is the only line that grows when you ask for longer answers.

Four lines, four different prices for the same unit of text. A 20,000-token system prompt is not one cost. It is one cost the first time, a slightly higher one if you chose to store it, and a very small one on every call after that. Bills that ignore this distinction charge you the baseline rate hundreds of times for the same bytes.

03 / Receipt A: the loop that rebuilt its own context every call

Here is the naive shape. An agent runs 100 turns. Each turn sends the full system prompt, tool definitions, and the whole conversation so far, rebuilt and billed as fresh input. For the arithmetic, use placeholder rates of $0.50 per million input tokens, $0.625 per million cache writes, $0.05 per million cache reads, and $5.00 per million output tokens. Substitute your own provider's numbers; the shape of the result barely moves.

  • ■ Input: 20,000 tokens per call times 100 calls = 2,000,000 tokens = $1.00
  • ■ Cache write: none, nothing was cached = $0.00
  • ■ Cache read: none = $0.00
  • ■ Output: 150 tokens per turn times 100 turns = 15,000 tokens = $0.075
  • ■ Receipt A total: $1.08 for 25 useful results, or 4.3 cents per result

Look at where the money went. Ninety-three percent of the bill is input, and almost all of that input is the same 18,000 tokens repeated. The work that produced the answers cost 7.5 cents. The repetition cost a dollar.

04 / Receipt B: the same workload with a cached prefix

Now split the prompt. Put the stable 18,000 tokens, the system prompt, the tool schemas, the fixed instructions, into a cached prefix. Keep only the new turn content as fresh input on each call.

  • ■ Cache write: 18,000 tokens stored once = $0.011
  • ■ Cache read: 18,000 tokens times 99 later calls = 1,782,000 tokens = $0.089
  • ■ Input: 2,000 new tokens per call times 100 calls = 200,000 tokens = $0.10
  • ■ Output: unchanged at 15,000 tokens = $0.075
  • ■ Receipt B total: $0.28 for the same 25 useful results, or 1.1 cents per result

Same 2 million tokens, same 25 results, 74 percent less money. The cache write line cost a little over one cent and bought 99 cheap reads. The output line did not move at all, because output pricing has nothing to do with how you organize your prompt.

This is the whole trick, and it is not a trick. It is the pricing model telling you that repetition is expensive and memory is cheap.

05 / Cache reads are the discount you earn by keeping your context stable

A cache read is not a coupon. It is a line item that appears when you do the boring engineering work of making the front of your prompt identical across calls. If a timestamp, a random session id, or a reordered tool list lands at the top of the prompt, the prefix does not match and every read degrades into a full input charge. The bill will not warn you. It will just quietly move tokens from the cheap line to the expensive one.

Three habits keep tokens on the cheap line.

  • ■ Put volatile content last. Logs, user messages, retrieved documents and timestamps belong after the stable prefix, never before it.
  • ■ Keep tool definitions and system instructions byte-identical between calls. A regenerated schema is a new prefix.
  • ■ Cache the largest stable block, not a small one. A cached 500-token header saves almost nothing; a cached 18,000-token context saves most of the input bill.

Long-running agents benefit most, because they pay for the same context dozens or hundreds of times. Single-shot calls benefit least, since there is no second call to read the cache. Judge your workload honestly before you reorganize anything.

06 / Where cache writes turn into waste on the next bill

Caching is not free. The write line charges a premium over plain input, and that premium is only worth paying if the cached prefix gets read again. Write a 40,000-token prefix on a one-off request and you paid more than double for nothing. Write it once and read it 200 times and you paid about 4 percent extra on the storage and saved nearly 90 percent on the reuse.

So audit the write line with one question: how many reads did each write earn? If your bill shows large cache write totals alongside small cache read totals, you are paying the premium and skipping the savings. If the read line dwarfs the write line, the design is working.

Then judge everything by price per useful result, not by price per million tokens. A cheap model that rambles and produces 12 useful answers can lose to an expensive one that produces 25. Multiply output tokens by the output rate and divide by the results you actually kept. That single number beats any rate card.

CheapRelay bills per real token across all four lines, including cache reads and cache writes, with no monthly fee and no subscription, so this arithmetic stays visible on every receipt. One key covers models like Claude Haiku 4.5 and DeepSeek V4 Flash, and works with the OpenAI SDK and the usual coding agents. Sign up, run your agent loop twice, once with a cached prefix and once without, and read the four lines back to back. The gap between them is money you were spending on repetition.

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

More reading

DateAisleWritten inTitle
2026-10-30Spend lessENTwo Chatbot Receipts: $0.03 and $0.31 per Resolved Ticket
Two support chatbot bills side by side, judged only on price per useful result, with the routing and caching math that cut spend.
2026-10-30Spend lessENSoftware 0 Cents, AI Capped at 40,000 Tokens
A beginner weekend plan for a receipt-sorting CLI: free tools, one API key, and a hard cap of 40,000 tokens.
2026-10-30Spend lessENTag 10,000 Feedback Lines for About $0.66
A beginner walkthrough: tag 10,000 feedback lines with a cheap model for roughly $0.66, plus batching, caching and a human review plan.
2026-10-30Spend lessENOne AI Request Costs $0.004: The Receipt Math
Estimate cost per user for an AI feature on a tiny budget: token counting, cache billing, a $20/month worked example, and a receipt line that proves it.
2026-10-30Spend lessEN50k tokens, one key, under $1: a fair price check
A beginner, tiny-budget walkthrough for comparing official list prices with relay prices using per-token math, cache lines and a real receipt.
2026-10-30Spend lessEN$0.0031 per accepted answer: rank models by the receipt
A beginner walkthrough of cost per accepted answer, run on a $10 budget with two toy price schedules and a real receipt line.