[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)

Oct 27

Prompt caching takes effect only if the cached prefix matches strictly, so the design of the context structure directly determines the hit rate.

Unverified50%
Oct 27

Prompt caching is an inference optimization mechanism introduced by mainstream large-model API providers: when the prefix portion of a request is exactly identical to that of a previous request, the server can directly reuse the already-computed KV cache without re-running the forward computation.

Unverified50%
Oct 27

The cost reduction stems from a rearchitecting of the Agent's context management mechanism, reducing the number of tokens required per session while increasing the reuse rate of prompt caching, rather than an adjustment of billing rates.

Unverified50%
Oct 19

Prompt caching is isolated per model rather than per session; measured in real coding sessions, when switching models mid-session, in 82% of cases cache reads fell below 10% of the previous value, and a warm 107000-token prefix became 110000 tokens of uncached input at roughly ten times the cached price.

Unverified50%
Oct 18

When contextual retrieval uses prompt caching, the cost is about $1.02 per million document tokens, one-time.

Unverified50%
Oct 18

The hard prerequisite for prompt caching to take effect is prefix determinism: any dynamic content located in the prefix (timestamps, user IDs, randomly ordered tool lists) causes the cache key to change, driving the hit rate to zero.

Unverified50%
Oct 18

OpenAI's automatic prompt caching gives a 50% to 75% discount on matching prefixes over 1024 tokens, with no explicit declaration required.

Unverified50%
Oct 18

Under the reference workload (1,100 tasks per month, each with 12K fresh input, 48K cached input, and 6K output tokens), enabling caching saves about $190 per month compared with not enabling it.

Unverified50%
Oct 18

The architectural constraint of prompt caching is: stable content (system instructions, context, examples, etc.) goes first and must be byte-identical each time, while variable content goes at the end.

Unverified50%
Oct 18

Prompt caching matches an identical token sequence backward from the beginning of the prompt, and the matched portion receives the discount; once the tokens diverge, subsequent content is billed at full price.

Unverified50%

40 more timeline events

All Facts (20)

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

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

75%
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

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

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.

65%
Verified

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

65%
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.

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%
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).

65%
Unverified

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

60%
Unverified

Prompt caching takes effect only if the cached prefix matches strictly, so the design of the context structure directly determines the hit rate.

50%
Unverified

The cost reduction stems from a rearchitecting of the Agent's context management mechanism, reducing the number of tokens required per session while increasing the reuse rate of prompt caching, rather than an adjustment of billing rates.

50%
Unverified

Prompt caching is an inference optimization mechanism introduced by mainstream large-model API providers: when the prefix portion of a request is exactly identical to that of a previous request, the server can directly reuse the already-computed KV cache without re-running the forward computation.

50%
Unverified

Prompt caching is isolated per model rather than per session; measured in real coding sessions, when switching models mid-session, in 82% of cases cache reads fell below 10% of the previous value, and a warm 107000-token prefix became 110000 tokens of uncached input at roughly ten times the cached price.

50%
Unverified

When contextual retrieval uses prompt caching, the cost is about $1.02 per million document tokens, one-time.

50%
Unverified

The hard prerequisite for prompt caching to take effect is prefix determinism: any dynamic content located in the prefix (timestamps, user IDs, randomly ordered tool lists) causes the cache key to change, driving the hit rate to zero.

50%
Unverified

OpenAI's automatic prompt caching gives a 50% to 75% discount on matching prefixes over 1024 tokens, with no explicit declaration required.

50%
Unverified

The architectural constraint of prompt caching is: stable content (system instructions, context, examples, etc.) goes first and must be byte-identical each time, while variable content goes at the end.

50%
Unverified

In multi-turn conversations, each new message extends the history backward, so the cache can only match up to the last stable breakpoint; if an implementation inserts a rolling summary, current-turn metadata or reformatted history at the front, the entire prefix shifts and the hit rate erodes.

50%

Source Articles