An AI bill has four token lines: fresh input, cache reads, cache writes and output. In agent work, cache reads and writes are usually most of the money, not the output. Multiply each line by its price before deciding what to fix.

This is for founders and developers who pay for model APIs or watch Claude Code's usage screen and want to know where the money goes. Prices are from Anthropic's price table as of October 2026.

See it in actionWhere one $0.55 usage line goes
One $0.55 usage line splits into cache reads at $0.28, cache writes at $0.19 and output at $0.08. Re-reading the conversation is the biggest line. Illustrative example. Use the playback controls or the thin timeline at the top to explore.

In short:

  • Output is often under 15% of an agent's bill.
  • Claude's input_tokens excludes cached tokens. OpenAI's includes them.
  • A cache write the size of your context usually means a cold restart.
  • Gemini bills thinking tokens at the output price.

Four lines, four very different prices

Each line has its own price, and the gap between them is large. Here are Claude Sonnet 4.6 list prices per million tokens, from Anthropic's prompt caching price table.

Line What it is Sonnet 4.6 price
Input New tokens, not cached $3.00
Cache read Repeated prefix, reused $0.30
Cache write Prefix stored for reuse $3.75 (5 min), $6 (1 hour)
Output Tokens the model writes $15.00

A cache read costs a tenth of fresh input. A write costs more than fresh input. Output costs five times input.

One real usage line, taken apart

Claude Code's cost docs show this example from its /usage screen:

claude-sonnet-4-6: 1.2k input, 5.3k output, 940.0k cache read, 50.0k cache write ($0.55)

Priced at Sonnet 4.6 rates with 5-minute writes, cache reads made half of that bill.

Line Tokens Cost Share
Cache read 940,000 $0.28 51%
Cache write 50,000 $0.19 34%
Output 5,300 $0.08 14%
Input 1,200 $0.004 1%

The model wrote 5,300 tokens and read almost a million. That is normal for an agent, which re-sends its whole conversation on every step.

Each provider reports the lines differently

The same four ideas have different field names, and one difference catches people out. On Claude, input_tokens counts only tokens after the last cache breakpoint. On OpenAI, input_tokens is the total, and cached tokens are a part of it.

Provider Cache read field Cache write field
Claude API cache_read_input_tokens cache_creation_input_tokens
OpenAI API input_tokens_details.cached_tokens input_tokens_details.cache_write_tokens
Gemini API cached token count in usage metadata none for implicit caching

On Claude, add all three input fields to get total input, as Anthropic's docs explain. The response also splits writes into 5-minute and 1-hour buckets. The OpenAI prompt caching guide points to its Prompt Caching Dashboard for watching your cache hit rate.

Reasoning adds one more wrinkle. Gemini's pricing page lists output prices "including thinking tokens", so thinking you never see is billed as output.

What each line tells you to fix

Each line points to a different cause. Read the biggest one first.

  • Cache reads high: your context is big and you take many steps. Compact sooner or split tasks.
  • Cache writes high: your prefix keeps changing or expiring. Look for timestamps, tool changes or long breaks.
  • Input high: caching is off, or your prefix is below the minimum length.
  • Output high: long answers or heavy thinking. Lower the effort or ask for shorter replies.

A healthy agent loop usually shows over 90% of input as cache reads. In our own Claude Code history, the share was 98.2%.

Spotting a cold restart in the numbers

A cache write about as big as your whole context usually means the cache expired, or something near the start of the prompt changed. Expiry often follows a break longer than the cache lifetime.

At Opus 5 list prices, a 300K session that goes cold pays $3.00 to write its context back, against $0.15 to read it warm. If you see big writes after pauses, compact before breaks. Cache TTL: when a coffee break costs money has the break-even.

How GrowApps reads its own lines

GrowApps records the input, cached input and output of every model call in a build. That is how we found that input was 86% of one long build's cost and output only 14%.

It is also how we spotted a bug where a summary was rewritten every call and every call missed the cache. See why most of an AI build's cost is input.

Price your last session in five minutes

Copy the token counts from your last session. In Claude Code, /usage shows them. Multiply each line by its price from the Anthropic pricing page, then sort by cost. Fix the biggest line first.

Frequently asked questions

Why is my output so cheap compared to the total?

Because an agent reads far more than it writes. Each step re-reads the conversation, so reads grow with every step, while output stays small.

Do subscription plans bill these lines?

Not directly. Claude Code's docs say the dollar figure in /usage is for API users, and subscribers see plan usage bars instead. Anthropic does not publish how plan usage maps to these lines, so treat them as a guide.

Sources and further reading