Caching discount¶
Prompt tokens served from cache bill at the model's cached rate; the exact number per
model is on the rate card, and in /v1/models as
pricing.input_cache_read. A cached token costs at most the uncached rate, and there is no
write fee.
No configuration¶
There is no cache_control block, no cache API, and no TTL to manage.
Seeing it¶
- API:
usage.prompt_tokens_details.cached_tokenson every response. - Portal: cached-token badges on the Usage day view and the Billing ledger.
"usage": {
"prompt_tokens": 1874,
"completion_tokens": 212,
"prompt_tokens_details": { "cached_tokens": 1792 }
}
That request's input cost: 82 × input rate + 1792 × cached rate.
Getting the most from it¶
- Stable prefixes win. Keep the shared part (system prompt, examples) byte-identical and put variable content after it; matching keys on the early part of the conversation, and caches match exact prefixes.
- Long shared prefixes win. A sentence or two in common isn't enough to key on; a system prompt, a few-shot block, or an attached document is.
- Bursts win. Warmth fades after roughly a quarter of an hour without traffic on that prefix; steady streams of same-prefix requests hit nearly every time.
- Templates travel. A system-prompt template reused across your workspace is matched everywhere it appears, not only inside one conversation.
- Correctness first, then warmth. If a request needs something the warm route can't do, you add tools or JSON mode mid-conversation, capability wins the pick and the request routes elsewhere.
- Misses are neutral. A cache miss bills at the normal input rate.
Rates per model: Models & pricing.