Prompt Caching
A prompt caching mechanism of the Anthropic API that caches the computation of repeated long prefixes, such as system prompts and document libraries. Cache hits are billed at a lower cache-read rate, while pricing tiers are based on the total number of prompt tokens.
Timeline (last 90 days)
According to a cross-vendor empirical comparison, reusing a 100,000-token prefix can reduce costs by 71% to 93%.
Prompt caching takes effect in units of "prefix" and only works for content that is completely identical from the start; once a token in the middle changes, the content after it cannot hit the existing cache.
A calculation example: asking 20 questions about a 50,000-token document requires about 1 million input tokens without prompt caching, and about 157,000 with caching, reducing input cost by about 84%, with faster time to first token as well.
Prompt caching divides prefixes by 'breakpoints', and the prefix must be byte-for-byte identical to hit the cache, so it is critical to put unstable content such as timestamps and random IDs in the suffix.
The price of prompt cache reads is only 0.05×–0.1× the normal input price (depending on the model), the Batch API enjoys a 50% discount when you can wait, and Anthropic charges an additional $10 per 1,000 searches for web search.
A prompt cache hit requires the request prefix to be byte-for-byte identical to what was written at cache time; mixing dynamic content such as timestamps or session IDs into system prompts will cause frequent cache invalidation.
In cache-intensive, long-context, multi-turn agent workflows, the incremental cost of switching to a more powerful model is diluted by cache reads and does not necessarily mean costs double.
All Facts (7)
According to a cross-vendor empirical comparison, reusing a 100,000-token prefix can reduce costs by 71% to 93%.
50%UnverifiedPrompt caching takes effect in units of "prefix" and only works for content that is completely identical from the start; once a token in the middle changes, the content after it cannot hit the existing cache.
50%UnverifiedA calculation example: asking 20 questions about a 50,000-token document requires about 1 million input tokens without prompt caching, and about 157,000 with caching, reducing input cost by about 84%, with faster time to first token as well.
50%UnverifiedPrompt caching divides prefixes by 'breakpoints', and the prefix must be byte-for-byte identical to hit the cache, so it is critical to put unstable content such as timestamps and random IDs in the suffix.
50%UnverifiedThe price of prompt cache reads is only 0.05×–0.1× the normal input price (depending on the model), the Batch API enjoys a 50% discount when you can wait, and Anthropic charges an additional $10 per 1,000 searches for web search.
50%UnverifiedA prompt cache hit requires the request prefix to be byte-for-byte identical to what was written at cache time; mixing dynamic content such as timestamps or session IDs into system prompts will cause frequent cache invalidation.
50%UnverifiedIn cache-intensive, long-context, multi-turn agent workflows, the incremental cost of switching to a more powerful model is diluted by cache reads and does not necessarily mean costs double.
50%