[KongchangAI]
ConceptPrompt Caching

Prompt Caching

An inference optimization mechanism in large language model APIs that reuses the KV Cache of unchanged prefix portions—such as system prompts and tool definitions—across multi-turn conversations on the server side, avoiding redundant computation and thereby reducing latency and API call costs.

Core Facts

Timeline (last 90 days)

Nov 22

Claude API prompt caching works by "prefix matching" and requires developers to explicitly mark the cached content.

Unverified50%
Nov 20

On a prompt cache hit, first-token latency and input token billing both drop significantly; on a miss, it is equivalent to an ordinary request.

Unverified50%
Nov 20

Mainstream prompt caching implementations typically require the cached prefix to be byte-for-byte identical and valid within a certain time window.

Unverified50%
Nov 19

Prompt caching is a technique for optimizing inference costs: when multiple requests contain the same prefix, the inference provider can cache that portion of the computation and reuse it directly in subsequent requests, thereby reducing redundant computation.

Unverified50%
Nov 18

Cache hit rate (prompt caching) refers to the mechanism in AI APIs whereby repeatedly appearing prefix content is cached, and subsequent requests that hit the same prefix are billed at a lower price and responded to faster.

Partially Verified75%
Nov 17

The prompt caching mechanism allows the server to reuse the intermediate state of shared prefix content, charging a price far below standard input for these tokens.

Unverified50%
Nov 14

Prompt caching only changes the billing price, not the capacity limit of the context window; the sum of all counts (including cache reads and writes) is still subject to the window limit.

Unverified50%
Nov 14

A prefix cache entry is only available after the first response begins; 100 parallel requests with the same prefix sent at the same time may all write and each pay the write price, and the correct approach is to send one first, wait for its response to begin, then send the rest.

Unverified50%
Nov 14

Taking Sonnet 5.5 as an example, an uncached request costs 1 unit, while with 5-minute caching a write of 1.25 plus a read of 0.05 equals 1.3, so it breaks even on the second request within the lifetime; 1-hour caching only wins with at least three requests within the window.

Unverified50%
Nov 14

When the prefix is shorter than the model's minimum cacheable length, it is silently treated as uncached without an error, and the minimum value varies from 512 to 4096 tokens across models.

Unverified50%

40 more timeline events

All Facts (20)

Verified

Common context pruning strategies include sliding window (retaining the most recent N messages), summary compression (summarizing old messages into a summary), and importance filtering (prioritizing the retention of tool call results).

90%
Verified

Token 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.

80%
Verified

The 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.

80%
Verified

Prompt caching is a capability of the Anthropic API: when the prefix portion of a request is exactly identical to the previous request, the server can reuse the already-computed intermediate state and skip redundant prefill computation.

75%
Verified

The higher the cache hit rate, the closer the actual billing is to the cache price rather than the full input price, which can reduce costs by an order of magnitude.

75%
Verified

The KV Cache mechanism avoids repeated computation of historical tokens, but its memory usage grows linearly with context length.

75%
Verified

The 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.

75%
Verified

The caching mechanism is technically commonly referred to as KV Cache or Prompt Caching

70%
Verified

Prompt caching means the identical prefix shared by multiple requests is fully billed and processed only on the first request, and subsequent requests hitting the cache can lower the input token price and reduce latency; but caching cannot shorten the total context length, and long histories still occupy the context window and raise latency.

65%
Verified

Cached input tokens are a discount mechanism offered by providers such as OpenAI for large repeated prefixes (such as system prompts, long documents, and few-shot examples); input tokens that hit the cache are billed at a lower rate, usually only about one-tenth of the standard input price.

65%
Verified

Prompt 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%
Verified

Cache entries have a validity period of approximately 5 minutes (default) to 1 hour (extendable), after which they are treated as cache misses.

65%
Verified

Prompt caching saves pre-computed KV matrices on the server side, reducing the processing of repeated prefixes from O(n²) to O(1) cache reads, enabling up to 90% compression in latency and cost.

65%
Partially Verified

Cache hit rate (prompt caching) refers to the mechanism in AI APIs whereby repeatedly appearing prefix content is cached, and subsequent requests that hit the same prefix are billed at a lower price and responded to faster.

75%
Unverified

When developers adjust the schema of structured output, the new version can retain previous reasoning content and reuse the prompt cache.

70%
Unverified

Anthropic's prompt caching is divided into two write durations, 5 minutes and 1 hour, with different write prices, while the read price is uniform and far lower than the regular input price.

60%
Unverified

Prompt caching allows vendors to cache the same repeated prefix in an Agent loop, with subsequent calls billed at the cache read price, in this example $0.20 versus $4 for input, 20 times cheaper.

60%
Unverified

Prefix caching is extremely sensitive to input stability; as long as any single token in the prefix is modified or inserted, the cache is invalidated and all subsequent content must be recomputed.

60%
Unverified

Claude API prompt caching works by "prefix matching" and requires developers to explicitly mark the cached content.

50%
Unverified

Mainstream prompt caching implementations typically require the cached prefix to be byte-for-byte identical and valid within a certain time window.

50%

Source Articles