Prompt caching

Prompt caching lets a provider reuse the processed form of a repeated prefix across requests, billing those tokens at a fraction of the fresh rate.

Agent sessions repeat themselves enormously: the same system instructions, the same tool definitions, the same transcript prefix, on every single turn. Caching means the unchanged head of that is not reprocessed and not billed at full price.

The catch is that a cache is prefix-based. Change something early in the sequence and everything after it is fresh again. This is why the order in which context is assembled has a cost consequence that is invisible in a raw token count.

It also means raw and cache-weighted token counts can tell opposite stories. A change that lowers raw input while wrecking the cache can raise the bill. Comparisons that do not say which they measured are not comparisons.

All terms