Three kinds of tokens
A Claude Code session sends three kinds of tokens. Fresh input is text the model has not seen in this session: your prompt, newly read files and tool results. Cached input is context the provider already holds, usually the system prompt, earlier turns and files that were read before. Output is what the model writes: code, explanations and tool calls. Output is the smallest share of a session; cached input is usually the largest.
Why the cache dominates
An agent re-sends its whole conversation on every step so the model can continue the task. Providers recognise the repeated prefix and serve it from a cache at a fraction of the normal input price. In a long coding session it is normal for the cached share to be well above 80% of all input tokens. That is why a per-token price alone says little: what matters is the price of cached tokens and how many of them your session reads.
How Model.sale counts a session
Model.sale charges one flat rate per million charged tokens. Fresh input and output count in full; cached input counts at 40%. For a session, charged tokens = fresh input + output + 0.4 x cached input. At the time of writing the rates are $0.20 per million for claude-haiku-4-5-20251001, $0.55 for claude-sonnet-5-5 and $1.00 for claude-opus-5-5; the live table is on the Claude API page.
A worked example
Take a medium refactoring session: 150,000 fresh input tokens, 2,000,000 cached input tokens read over many turns, and 60,000 output tokens. Charged tokens = 150,000 + 60,000 + 0.4 x 2,000,000 = 1,010,000. At $0.55 per million (Sonnet 5.5) that is about $0.56; at $1.00 per million (Opus 5.5) about $1.01; at $0.20 per million (Haiku 4.5) about $0.20. A small bug fix with 20,000 fresh, 200,000 cached and 8,000 output tokens is 108,000 charged tokens: about $0.06 on Sonnet 5.5.
Estimate your own bill
Your dashboard shows the exact charge of every request, so run one representative task first and read its total. Multiply by how many such tasks you expect per day. The cost calculator on the site accepts fresh, cached and output tokens, and the method behind it is public in the pricing methodology. Compare the result with the invoice from any other provider for the same session rather than with a headline per-token price.
Keep spend predictable
Set limits before an agent runs unattended. In the dashboard a key can have a daily spend limit, a per-request cap and a model allowlist, and a prepaid wallet can never go below zero: when the balance runs out, requests stop instead of creating a surprise invoice. To start, follow the Claude Code setup guide and use the cheapest model that passes your own tests.