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 when a request includes the same system instructions, tool definitions and transcript prefix. Some clients defer detailed tool definitions, so the repeated prefix depends on what that client sends. Caching means an unchanged included prefix is not reprocessed and 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