Prompt Caching
A pricing optimization mechanism introduced by Anthropic that applies token-level cost discounts to reusable fixed-prefix portions of requests, such as system prompts, passing on savings from KV cache reuse to the billing structure.
Core Facts
The Claude API supports a Prompt Caching mechanism, where content is billed at full price on the first request, and subsequent tokens that hit the cache cost approximately 10% of the original price
The Prompt Caching mechanism can reuse the KV Cache of identical prefix contexts, typically reducing input token costs by 50%–90%.
The cache is not permanently valid; providers usually have a TTL of a few minutes to an hour, and the hit rate fluctuates with user behavior.
Timeline (last 90 days)
To achieve a high cache hit rate with prompt caching, stable content must be placed at the front of the prompt and variable content at the end, while keeping the request prefix byte-for-byte identical.
The cost of the fixed context can be approximated as: number of fixed-prefix tokens × number of calls × cache-read unit price.
Prompt Caching is a mechanism provided by large-model service providers such as the Anthropic API: when the request prefix is exactly the same as that of a previous request, the server reuses the already-computed KV Cache, the cache-hit portion is billed at 0.1 times the input price, and the first cache write is billed at 1.25 times.
The three-step cost optimization path: first identify shareable prefixes to assess cache hit potential, then migrate non-real-time tasks to the batch channel, and finally confirm the target platform's discount stacking rules.
The first prompt cache request is still billed at full price, and cache writes are sometimes priced separately.
Sharing cached prompts across four models produced cost savings of 78–80%.
Core decision rule: any content that changes per message must be placed after the last cache breakpoint, and the only reliable check is comparing two real requests rather than a single request.
Production-grade agents typically combine five strategies: Prompt Caching, Compaction, Tool-result Clearing, Retrieval, and Subagents.
Anthropic's Prompt Caching marks cache breakpoints via the cache_control field, allowing {"type": "ephemeral"} to be set on system prompts, tool definitions, or message blocks.
Anthropic's cache prefix must be exactly identical; any subtle change (such as a timestamp or random ID) will invalidate the cache.
40 more timeline events
All Facts (20)
The Claude API supports a Prompt Caching mechanism, where content is billed at full price on the first request, and subsequent tokens that hit the cache cost approximately 10% of the original price
80%VerifiedThe Prompt Caching mechanism can reuse the KV Cache of identical prefix contexts, typically reducing input token costs by 50%–90%.
80%VerifiedThe cache is not permanently valid; providers usually have a TTL of a few minutes to an hour, and the hit rate fluctuates with user behavior.
75%VerifiedThe core principle of prompt caching is cross-request reuse of the KV Cache, where already-computed KV states can be cached and reused when multiple requests share the same prefix.
75%VerifiedWhether prompt caching hits depends on byte-for-byte consistency of the request prefix; if even one character at the beginning differs, the entire cache is invalidated.
70%VerifiedOn most Claude models, Anthropic bills cache reads at 0.1× the base input price; default 5-minute cache writes at 1.25×; 1-hour cache writes at 2×; and a 5-minute cache entry is refreshed for free each time it is used.
70%VerifiedPrompt Caching is a cost-optimization mechanism introduced by mainstream LLM providers (such as Anthropic and OpenAI): when the prefix portion of multiple requests is completely identical, the provider caches that portion of the computation, and tokens that hit the cache are billed at a price far below normal input.
65%VerifiedPrompt caching saves the KV state of reusable prefixes (the tokens at the beginning of a prompt that remain unchanged); if the next request starts with an identical prefix, the provider reuses the saved computation and only processes the new portion.
65%VerifiedPrompt cache validity typically ranges from only a few minutes to several hours, and discount rates and cache windows may be adjusted at any time.
65%VerifiedToken caching (Prompt Caching) is a cost-optimization mechanism in large model APIs; when the same prefix appears repeatedly across multiple requests, the computation result can be cached and charged at a lower rate.
65%VerifiedPrompt Caching refers to LLM service providers caching repeatedly occurring prefix content in requests, with cache hits reducing computational cost and latency.
65%VerifiedSome service providers have introduced cache-hit pricing, charging at a lower discounted rate when repeated long system prompts hit the cache.
65%VerifiedThe caching mechanism is technically commonly referred to as KV Cache or Prompt Caching
65%VerifiedIn cache hit scenarios, hit tokens are typically charged at 1/10 of the original price or even lower
65%VerifiedThe disk caching mechanism persists already-computed KV Cache to storage media; when a subsequent request's prefix hits the cache, it can be reused directly, skipping redundant forward propagation.
65%VerifiedThe general principle for achieving cache hits is to keep the prefix of the request context as stable as possible, placing fixed content such as system prompts and tool definitions at the very front, with per-turn user input appended at the end.
65%VerifiedPrompt Caching reduces latency and token costs by reusing the KV Cache of identical prefixes to skip redundant computation.
65%UnverifiedAnthropic's Prompt Caching can reduce repeated input costs by 90%
80%UnverifiedPrompt caching technology stores KV matrices in high-speed memory, and when the next request contains the same prefix content, it reads directly from the cache, skipping recomputation.
70%UnverifiedPrefix matching requires that only a contiguous sequence starting from the first token that is completely identical can hit the cache.
70%