Atatus calculates a cost for each model call from its token counts and the rates for that model. This page explains how that works and how to read the numbers, including the cases where a cost is not available.

How cost is calculated

Cost is worked out per model call, from three separate quantities rather than one input total:
  • Uncached input tokens, charged at the model’s input rate.
  • Cache read tokens, charged at the model’s discounted cache-read rate.
  • Cache write tokens, charged at the model’s cache-write rate, which is higher than the input rate.
  • Output tokens, charged at the model’s output rate.
The three input quantities are separated because they are priced very differently, and treating them as one number gets the answer badly wrong for anything that uses caching.
Cost is calculated when the trace is received and stored with it. Changing anything later does not recalculate the cost of traces you already have.

How cached tokens are priced

Providers charge a fraction of the input rate for tokens served from cache, and a premium for writing them. The exact multipliers vary by provider, but the shape is consistent:
  • Cache reads cost substantially less than fresh input tokens.
  • Cache writes cost more than fresh input tokens, because the provider stores them for reuse.
Cache read and cache write counts are a breakdown of the prompt token count, not additions to it. If you sum prompt, cache read, and cache write, you have counted your input tokens up to three times.
So the input side of a call is:

Cached tokens dominate coding agent usage

For coding agents, almost all input tokens come from cache. A long session re-sends the same context on every turn, and the provider serves it from cache after the first time. In practice, cache reads commonly account for more than 95% of all prompt tokens in a coding session. Two consequences follow:
  • Cost is far lower than the raw prompt count suggests. A turn with 600,000 prompt tokens may cost a small fraction of what 600,000 fresh input tokens would.
  • A tool that ignores caching overstates spend heavily. Comparing Atatus against a calculator that charges every prompt token at the full input rate will not agree, and the calculator is wrong.
If you want to judge how efficiently a session used the cache, compare cache read tokens against total prompt tokens. A high ratio is good and means context is being reused rather than re-sent.

When cost reads as zero

Cost depends on knowing the rates for the exact model that served the request. When Atatus does not have rates for a model, it records zero cost for that call while still recording the token counts. A zero cost means one of these:
  • The model is not one Atatus has pricing for, which is common for new releases, self-hosted models, and models behind a gateway.
  • The provider reports its usage in something other than tokens. Kiro bills in credits, for example.
  • The call reported no usage at all, which happens when a turn is cancelled before it completes.
A zero cost does not mean the call was free. Treat project spend as a lower bound, not a total, and use token counts as the reliable measure when a cost is missing.

Turns with no tokens at all

A turn that you cancel partway through reports no usage, because usage is only reported when a response completes. The turn still appears in the trace so you can see it happened, but it has no tokens and no cost. Cancelling prompts is normal, so expect a share of turns to carry no usage. This is another reason project spend is a floor rather than an exact figure.

Model names

Cost lookup uses the model name exactly as the provider reports it, including any date suffix. Dated releases can be priced differently from the undated name, and the same model served through a cloud gateway can be priced differently again, so the full name is kept rather than shortened.

Next steps

  • Span kinds explains which spans carry cost at all.
  • Privacy covers what else is recorded alongside these figures.