Using Claude Code on a subscription means not paying per token. But I wanted to know: what would my usage cost on the API? The answer depends on which token count you trust.
Same session, two token totals
One API call can write several records to the transcript, one per content block of the answer. The input and cache counts are the same in each record. Claude Code’s /stats adds all of them. Claude Code Session Analytics counts each call once, and keeps the /stats arithmetic in extra columns, to compare.
For my last 30 days: 468 million tokens counted once, 956 million with the /stats arithmetic. Approximately two times.
The cost model
- A price list in a file. Claude API list prices live in a CSV in the repository, one row per model and date.
- Append-only. A price change is a new row, never an edit. A call from August keeps the August price.
- Unknown means unknown. A model with no price gives no cost, not zero. Zero would make the total look smaller.
- Long-context tiers. Above a prompt-length threshold, some models have a higher rate. The full request then uses the long rates.
The result
Three months of my usage at API list prices:
| Window | Counted once | /stats arithmetic |
|---|---|---|
| Last 30 days | $194.24 | $407.98 |
| All time (2026-07-18 to 2026-10-17) | $852.34 | $1,560.19 |
These are estimates, not a bill. But they show two things.
- A count that adds every record almost doubles the cost.
- The cost is low for 1.83 billion input tokens, because 96.74% of them were cache reads, and a cache read costs a fraction of a normal input token.
Where the cost came from
My biggest session made 286 API calls and used 48 million input tokens, 99.38% of them from the cache. A long session re-reads a growing context on every call. Sub-agents took 23.9% of the input tokens. And sessions that start other sessions form chains — 60 families in my data — so the real cost of a feature is the cost of the chain, not of one session.
What the numbers are not
- Not a bill. A subscription has its own limits and its own price.
- Not exact for every call. A call before the first price row, or a model with no price, has no cost and is left out — 20 internal
<synthetic>calls in my data. - Not representative of future prices. Prices change, and the next price change is a new row in the token pricing CSV.
What I learned
- Count each call once. Before you price tokens, deduplicate them.
- Version the prices. Prices change. An append-only list keeps old estimates stable.
- The cache is the price. At 96.74% cache reads, a lost cache costs more than a long answer.
- Short sessions are cheaper. Context grows with each call. Start a new session when the task changes.
More information
The deep dive Token accounting explains the counting and the cost views.
Related: Is your Claude Code context actually optimised?