AI

What Is Prompt Caching and How Does It Cut LLM Costs

Prompt caching can slash LLM input bills 70 to 90 percent. Learn how it works, 2026 provider pricing, break-even math, and the traps to avoid.
Smart Caching for Faster AI Responses

Introduction

What is prompt caching and how does it cut LLM costs is the single question that decides production AI budgets in 2026. Prompt caching stores the computed attention state of a reusable prefix so later requests reuse it. Teams report cutting input bills by up to 77 percent on live agent traffic after wiring it in. The three major providers price cached reads at one tenth of the standard input rate. That turns long system prompts from a liability into a nearly free setup cost. This article covers the mechanics, the price sheets, the break-even math, and the common traps. Readers will leave with a working mental model and concrete pricing numbers.

Quick Answers on Prompt Caching and LLM Cost Control

What is prompt caching and how does it cut LLM costs in simple terms?

Prompt caching stores the attention state of a reusable prompt prefix and bills reused tokens at ten percent of base input price, cutting LLM input spend sharply.

Which providers support prompt caching in 2026?

Anthropic, OpenAI, Google Gemini, Amazon Bedrock, DeepSeek, and xAI all support prompt caching with slightly different pricing, minimum token thresholds, and cache time-to-live windows.

How much can prompt caching reduce LLM costs on a real workload?

Documented prompt caching savings run from 50 percent on OpenAI implicit caching to 90 percent on Anthropic for stable long prompts, with production teams reporting 70 to 85 percent cuts.

Key Takeaways on Prompt Caching

  • Cached input tokens bill at roughly 10 percent of the base rate on Anthropic and 50 percent on OpenAI.
  • Every major provider enforces a minimum cacheable prefix of about 1024 tokens, so short prompts rarely benefit.
  • Cache hits reduce time to first token by 50 to 85 percent on long prefixes.
  • Break-even sits near 2 cache reads per write on Anthropic and the very first read on OpenAI legacy.

Understanding What Is Prompt Caching and How Does It Cut LLM Costs

What is prompt caching and how does it cut LLM costs is answered by one idea: the system stores the attention state of a stable prompt prefix and bills reused tokens at a reduced cache read rate.

An Interactive From AIplusInfo

Prompt Cache Break-Even Calculator

Set the provider, the stable prefix length, and the hits per cache write. See the resulting monthly spend and savings against the uncached baseline in real time.

Anthropic Claude Sonnet

cache read discountwrite premium

8,000

1,02440,000

8

140

500

105,000
Monthly cost without cache $0 Baseline input spend only
Monthly cost with cache $0 Includes write premium
Savings vs uncached 0% $0 saved per month

Model assumes a base input price of $3.00 per million tokens and the provider pricing described above. See the full article on prompt caching costs for sources.

The KV Cache Behind the Curtain

Every transformer-based language model already keeps a short-lived key-value cache inside a single request. Prompt caching simply promotes that cache into a durable server-side artifact. During token generation the model reads previous tokens through attention, and recomputing those keys and values every step would waste compute. The model stores those tensors in GPU memory and reads them back as each new token appears. A prompt cache extends that same idea across requests by persisting the tensors for a stable prefix. The OpenAI prompt caching guide describes this as storing kv tensors for a reusable prefix. Reuse of that stored state requires an exact byte-for-byte match of the prefix across the two requests. A single changed character invalidates the cache from that point onward in the request.

Caches live on specific inference machines, not on a global shared tier, which has two practical consequences. Requests that land on a different machine will miss on the cached prefix entirely. Providers use routing hints like the Anthropic cache_control marker or the OpenAI prompt_cache_key to concentrate related traffic. The cache behaves less like a database and more like a warm memory pool on the serving node. Cache entries are also subject to eviction under memory pressure during traffic lulls. Teams that treat prompt caching as a permanent store will find themselves surprised by quiet weekend costs.

The prefix matching rule explains much of the surface behavior that confuses first-time users of prompt caching. Moving a time stamp from the top of the prompt to the bottom turns a cache miss into a cache hit. Reordering tool definitions or inserting a new system role mid-prompt will each invalidate the cache from the first changed byte. Most providers treat tool schemas, system prompts, and long document attachments as excellent cache candidates. The cache is a bet that the first N tokens will look the same across many requests, so good benchmarking matters. A good benchmark LLM latency and throughput workflow catches cache drift early.

How Providers Price Cache Reads and Writes

Building on that foundation, pricing varies enough between providers that a prompt tuned for one cache can lose money on another. Anthropic charges 10 percent of the base input rate on cache reads, which is the headline 90 percent discount quoted by many bloggers. Writes carry a premium that rewards reuse and penalizes one-shot caching across all of Anthropic’s tiers. The 5 minute tier costs 125 percent of base input and the 1 hour tier costs 200 percent of base. A million cached input tokens on Claude Sonnet reads at roughly 30 cents against 3 dollars uncached. The arithmetic rewards reuse rather than one-shot caching, and the Introl caching infrastructure guide calls it a ten times cost spread.

Shifting focus to OpenAI, cached input prices at roughly 50 percent of base for legacy models and as little as 10 percent for GPT-5.6 and later. Writes carry no premium on older models, which makes OpenAI the easier provider to opt into. The newer GPT-5.6 behavior adds a write surcharge for the 30 minute and 12 hour tiers. The pricing sheet has started to converge toward the Anthropic model over time. Cached reads on Google Gemini depend on the cached context size and the storage window the developer chooses.

Turning to the minimum cacheable prefix, all four big providers settled around 1024 tokens as the floor. Prompts below that threshold are ignored by the cache layer entirely. Amazon Bedrock complicates the picture with a two-checkpoint model requiring 1024 and 2048 tokens on Claude 3.5 Sonnet. Minimum prefix length is the most common reason that a seemingly perfect prompt never produces a cache hit. If the system prompt plus tool schemas falls under 1024 tokens, the cache layer never engages at all. Every request then pays the full input price without any discount applied. Teams that track generative AI cost per token trends learn to pad prompts intentionally with stable reference text.

Beyond those read and write numbers, cache TTLs round out the pricing picture across every major provider’s documentation. The Anthropic 5 minute window renews on every hit, so a steady stream of reads keeps the cache warm indefinitely. OpenAI legacy caches live in memory for 5 to 10 minutes of inactivity and up to one hour of total age. Gemini explicit caching accepts arbitrary TTLs charged by the hour. Teams that pick the longest TTL will pay more during quiet hours and less during busy ones. Teams that pick the shortest TTL pay less overall but miss more often during traffic lulls. This cost model intersects with broader enterprise AI cost optimization playbooks.

What Is Different Across Anthropic, OpenAI, and Gemini Caching

Looking across providers, the three leaders converge on the same mechanism but diverge on the interface the developer touches. Anthropic requires explicit cache_control markers on system messages, tool definitions, or user content blocks. OpenAI caches automatically once the prefix exceeds 1024 tokens, so the developer only needs a stable prompt_cache_key. Gemini splits the two with implicit caching on repeats and explicit cached_content resources by id. Those interface differences shape what prompt structure looks like in each ecosystem. Picking the right stack now includes cache-tier behavior when choosing the right AI model.

Beyond the surface api, the three vendors differ on write premium, hit granularity, and tooling. Anthropic charges a premium write and offers four cache breakpoints per request. OpenAI charges no write premium on legacy models and reports hits in 128 token increments. Gemini wraps cached content in a server-side resource with its own lifecycle calls. Picking the right combination depends on whether the application faces bursty user chats or steady document reasoning. Mixed shops often choose explicit on their highest-volume path and implicit on experimental surfaces.

Where the Cost Savings Actually Come From

Turning to the economic engine, the savings from prompt caching concentrate in exactly two situations. Long stable system prompts and long reused context attachments produce almost all of the measured savings on production workloads. A chat app that passes a 4000 token system prompt on every call pays four thousand input tokens per turn. With 10 messages per session that system prompt alone is forty thousand tokens before reasoning happens. Cache that prefix and the second through tenth turns each bill the 4000 tokens at 10 percent. That converts a repetitive cost into a tiny overhead for the full session.

Shifting focus to agent workloads specifically, the savings widen further than they do in standard chat applications. A tool-using agent that calls the model thirty times per task carries its tool definitions through every turn. The fixed prefix dominates the token budget on those workloads. DerivAI reported a 77 percent cost reduction on a live agent after enabling cache markers. The team wrote up the rollout in a production prompt caching case study. When the repetitive tokens are 70 percent of each request, caching them is close to a 70 percent cost cut.

Beyond the headline cases, caching pays almost nothing when the prefix barely crosses the minimum threshold. A product that personalizes the first sentence of the system prompt with the user name will never produce a cache hit. A support ticket router that swaps a one-line subject at the top of every call sits in the same situation. The right fix in those situations is prompt restructuring rather than giving up on caching entirely. Move the stable content to the top of the prompt and push the volatile content to the end of the request. Then confirm with cache usage reports that hits actually appear, drawing on how to reduce LLM inference costs for the broader checklist.

Latency Gains and Time to First Token

Beyond the cost story, faster responses are the second prize that prompt caching hands teams. Time to first token is dominated by the prefill phase, which the cache collapses to a memory copy. When the cache serves the prefill, that phase shrinks from tens of thousands of multiplications to a memory copy. The reader sees the first streamed token within hundreds of milliseconds instead of seconds. Anthropic claims up to 85 percent lower latency on long prompts in cache hit mode. OpenAI reports similar gains for GPT-5 class models on repeat requests.

Looking ahead at user-facing impact, the latency win is biggest in multi-turn conversations with heavy system prompts. A medical triage assistant that loads a 20 thousand token clinical reference every turn would feel sluggish without caching. Each turn would wait on prefill for several seconds without a cache. Latency also compounds in agent loops where a cached tool scheme saves prefill time on every planning step. The net effect is that caching makes a previously unusable high-quality model feel fast enough to ship. The pattern lines up with context engineering for LLM agents playbooks.

Cache Hit Patterns in Real Workloads

Building on that latency picture, real applications fall into a small set of cache hit shapes. Chat assistants with a stable system prompt sit in the sweet spot for prompt caching economics. Every turn after the first reuses the full system prefix. Coding assistants that load the current file and project brief also fit well. Document question and answer systems with one long source and many user questions fit best of all. The prefix can be 95 percent of the request on those workloads, and retrieval augmented generation versus fine tuning covers where each shape fits.

Shifting focus to less friendly shapes, personalization blows up the hit rate. Any workload that inserts user-specific data at the top of the prompt will miss on every unique user. Teams report dramatic variance between a prototype that caches well and a production system that caches badly. Multi-tenant systems need an engineering plan that preserves the stable prefix per tenant. Agent systems with volatile tool arguments can see a similar collapse. The fix is almost always the same restructuring, moving variable content toward the end.

Among the measured production profiles, hit rates cluster between 40 percent for lightly structured chat and 95 percent for tight agent loops. Brian Moonspot documented a Claude workload lifted from 0 to 92 percent hit rate in two days by moving three message blocks around. The team captured the work in a production prompt caching write-up that quantifies the shift. That hit rate change translated to a 78 percent drop in input spend on identical traffic. Measured hit rate is the single metric that predicts actual savings on any workload. Anything below 50 percent is usually an engineering problem rather than a pricing one.

Breaking Down the Break-Even Math

Beyond the hit rate profile, the break-even point for prompt caching rests on exactly three numbers that a team can compute in five minutes. Those three numbers are the write premium, the read discount, and the expected reads before the cache expires. On Anthropic the 5 minute cache write costs 125 percent of base input and the read costs 10 percent. A single prefix needs about 1.4 reads before the write premium pays itself off on that tier. On the 1 hour tier the write costs 200 percent and the read stays at 10 percent. Break-even then moves out to about 2.2 reads per written prefix. OpenAI legacy caches charge no write premium, so the first read saves money immediately.

Building on that math, the hit rate drives the final number downstream. A workload producing 10 reads per write at a 125 percent write premium saves roughly 65 percent against uncached input. A workload producing 3 reads per write saves closer to 55 percent on the same tier. A workload producing only one read per write still saves modestly on the 5 minute tier. The same single read loses money outright on the 1 hour tier for most workloads. Teams should refuse to pay for the long tier until measured hit rate justifies the upgrade.

Looking ahead at mixed workloads, the single-prefix formula generalizes smoothly to multi-prefix workloads with a weighted average. If 80 percent of traffic uses prefix A with ten reads per write, savings cluster near 70 percent. If the other 20 percent uses prefix B with two reads, the blend holds near that level too. The volatility question is whether any single prefix will have fewer than one hit before expiration. That case moves the economics from positive to negative within a single billing cycle. A monitoring dashboard tracking hit rate per prefix catches those loss cases before they accumulate.

Beyond the break-even number itself, the math exposes an idle penalty that is subtler. Every prefix that is cached but never read again costs the write premium with no offset at all. A support bot caching a long prompt for a user who never returns pays full write cost. The right countermeasure is to cache only the components used by many requests. Typically that means the system prompt and tool schemas rather than short per-user context. That discipline keeps the long tail of lost cache writes small enough to disappear.

Explicit Versus Implicit Cache Control

Shifting focus to control flow, each major provider forces a choice between telling the cache what to store and letting it decide. Anthropic uses explicit cache_control markers, which gives the developer full control over cache breakpoints. That control pays off when the prompt has several stable layers worth caching separately. OpenAI legacy caching is fully implicit and triggers automatically on any prefix over 1024 tokens. The newer GPT-5.6 era adds explicit prompt_cache_options for deterministic behavior on long tiers. Teams working with context rot inside long prompts often find explicit markers invaluable.

Turning to operational trade-offs, explicit caching rewards teams that treat prompts like code. A single accidental edit to a cached system prompt invalidates every active cache slot at once. That can spike cost overnight if the team does not monitor hit rate. Implicit caching smooths that risk by simply absorbing new prefixes as they appear. The trade-off for that convenience is reduced predictability on exactly when cache behavior will fire for any given request. Mixed shops often choose explicit on high-volume paths and implicit on experiments. The widget below lets readers see how the two modes change the effective cost curve.

Designing Prompts for a High Cache Hit Rate

Beyond raw tier selection, prompt engineering for caching is a small, specific discipline. The first principle is to move stable content to the top and volatile content to the bottom of every prompt. System instructions, tool schemas, and reference documents sit at the top and attract all the cache hits. User-specific data, the current turn, and any time stamps belong at the end. This single reordering move accounts for most of the hit rate improvements teams report. It costs nothing but a careful prompt rewrite and a staged rollout.

Looking ahead at tool definitions, teams that build agents should group tools into a stable schema block. Adding or renaming a tool should be rare enough to warrant a prompt version bump. It invalidates every active cache slot and forces a full warm-up period. For retrieval augmented generation, consider pinning the most frequently retrieved documents into the top. Those pinned documents act as a warm cache layer rather than re-retrieving each turn. The pattern meshes well with hybrid search and reranking pipelines.

Turning to the small details that matter, any dynamic timestamp or request id in the system prompt should move. A per-user id in the prefix would never produce a cache hit on new users. Example sections at the top should be stable across users, with per-user examples added below. Teams that version their prompts should treat each version as its own cache tenant. A shared cache across versions would simply miss on every call. A clean prompt structure plus consistent cache markers is often enough. Hit rate can climb from 30 percent to above 90 percent on the same workload.

Implementation Patterns for Agents and RAG Systems

Building on prompt design, agent systems and RAG pipelines deliver the largest headline wins from prompt caching. An agent loop typically carries a planning prompt, a tool schema, and the growing conversation history. The planning prompt and tool schema are the ideal cache candidates because they run unchanged through every turn. The growing conversation history belongs after the cache boundary where its churn cannot invalidate the stable planning prefix. On Anthropic that means a single cache_control marker on the last tool block. The entire planning prefix becomes cacheable without touching the message loop.

Turning to RAG, the pattern inverts slightly because retrieved context is the volatile part. The practical move is to cache the system prompt, the tool schemas, and the top retrieval candidates that repeat. A small catalog of frequently retrieved documents can even be pinned permanently to the cache. That pattern pairs well with structured retrieval approaches like GraphRAG against traditional retrieval. The graph seeds give stable context across many related queries. User-specific retrieval goes after the cache boundary where it cannot poison the prefix.

Looking ahead at multi-tenant deployments, implementation nuance focuses on tenant isolation. Each tenant should own its own cache key or prompt_cache_key to prevent cross-tenant hits. The small cost of a lower aggregate hit rate is more than offset by the risk reduction. Agent memory systems add another layer where episodic memory must stay tenant-scoped. The AI agent memory architecture decisions directly affect caching correctness. Teams that build this isolation into the framework rarely face a compliance incident later. Cache isolation becomes a first-order property of the architecture itself.

Risks and Correctness Traps When Caching

Shifting focus to the darker side, prompt caching is not free of risk. Most teams discover its sharp edges only after they cost real money or cause a real bug. The first and most common trap is staleness, where a cached system prompt serves outdated instructions. The mitigation is prompt versioning that rotates the cache key when the prompt changes. A second trap is cost overrun from aggressive caching of ephemeral content. A chat application that caches user messages will pay write premiums without seeing a hit, and deterministic guardrails for AI agents describe related failure modes.

Looking ahead at correctness, caching interacts badly with any system that mutates context between requests. A vector store that returns slightly different documents per call will miss anyway. The write premium paid on that prefix goes entirely to waste in that scenario without an offsetting cache hit. Caching the tool schema across users leaks capability information if access controls differ. Every cache breakpoint is a bet on a stable prefix. Any volatility upstream of that boundary turns the bet into a loss. Teams that monitor actual hit rate catch these problems within hours rather than weeks.

Privacy, Multi-Tenancy, and Compliance Concerns

Beyond raw correctness, privacy is the single most underrated aspect of prompt caching. It deserves a dedicated review before any production rollout touches a regulated workload. Caches are per-organization at every major provider, so no cross-tenant leakage is possible at the vendor level. The risk sits inside the organization where a shared cache key means cross-customer reuse. In a B2B SaaS product this is fine when the prefix contains no customer data. It becomes dangerous the moment the prefix embeds a document, a user id, or any PII.

Turning to compliance, regulated workloads in healthcare and financial services inherit provider caching behavior. Anthropic and OpenAI both claim cache contents are not used for training. Both claim contents are evicted after the TTL window closes. Teams in HIPAA or PCI scope should confirm that in writing anyway. Their business associate agreement should explicitly cover cache storage behavior. The practical rule is that caching is a cost lever gated by data classification.

Looking ahead at observability, teams should audit whether cached content appears in provider logs. Some providers include cache hit metadata in observability tools that embed otherwise-redacted content. A conservative rule of thumb is that anything written to the cache appears in at least one log line. Cache only content the team is willing to see repeated in an audit. For highly regulated domains teams can also run caching on a self-hosted vLLM stack. That keeps cached prefixes entirely inside the trusted boundary and sidesteps vendor telemetry concerns.

Ethics and Responsible Caching at Scale

Beyond compliance, caching intersects with responsible AI in a few quiet but important ways. A cached safety system prompt that is accidentally left unversioned can serve outdated harm-reduction guidance. That guidance can produce real downstream harm long after the team has updated it. The ethical floor is that every cached prompt layer tied to safety rotates on a documented schedule. Teams need the ability to force-expire the cache immediately in a safety incident. The same applies to legal disclaimers, age verification prompts, and any other policy-bearing prefix content.

Shifting focus to equitable access, aggressive caching can create tier-of-service gaps that are not obvious. A premium tier with a long cached system prompt gets lower latency than a free tier. The gap can be large enough to shape the product experience for both tiers. Teams should decide deliberately whether to equalize that gap or expose it. Either choice is defensible so long as it is made consciously and documented. Documentation of caching behavior in the product terms helps users understand what their tier buys.

The Future of Semantic and Cross-Provider Caching

Looking ahead, prompt caching in its current form is only the first generation. The research frontier is already pointing at semantic caching and cross-provider portability as the next layers. Semantic caching replaces the exact prefix match with an embedding similarity check. Paraphrased prompts that differ in surface wording can still produce hits using nearby embedding neighbors in vector space. Published work on GPTCache and SCALM reports 61 to 69 percent hit rates on query workloads. Those hits have up to 97 percent positive hit accuracy on test corpora. A two layer design combining prefix and semantic caching can push total hit rate above 90 percent.

Turning to cross-provider caching, pressure is building to let a cache written on one vendor be read on another. In practice the exact kv tensors cannot be shared because they are model-specific. The computed text summaries behind retrieval can be ported across models. Vendor neutral layers like LMCache are experimenting with prefix caching as an open protocol. Benchmarks claim 3 to 10 times latency reduction on self-hosted inference. If one of those efforts converges with provider adoption, teams will finally move between models without losing cache investment.

Beyond hit rate, the next shift is cost model simplification across all providers. OpenAI has moved to tiered TTL pricing with clear write premiums on newer models. Anthropic has published its tier math in the console for developer review. The direction of travel is toward a single lever per workload. Pick the TTL, pay a predictable premium, and read at a fraction of base rates. By 2028 expect the pricing surface to compress into roughly two tiers everywhere. Semantic caching should sit on top as a separate optional layer.

Chart From AIplusInfo

Cached vs Uncached Input Pricing Across Providers

Dollars per million input tokens on each provider, in cached and uncached form. The gap is the prompt caching discount.

Source: pricing drawn from the Introl prompt caching infrastructure guide and savings from the DerivAI production agent caching case study.

Measuring Cache Performance in Production

Beyond the future outlook, a production cache deployment lives and dies by the dashboards that monitor it. The core metrics are hit rate per prefix, cost per request, time to first token, and absolute write volume. Providers expose cache hit metadata directly in the response payloads sent back to every caller. Anthropic reports a cache_read_input_tokens field plus a cache_creation_input_tokens field on every single API call. OpenAI reports a cached_tokens count and Gemini reports a cached_content_token_count field on each call. Those raw fields should feed a per-prefix rollup for monitoring. A drop in hit rate then becomes visible within a single reporting window.

Shifting focus to alerts, three alerts are worth setting from day one. Hit rate below a threshold usually means a prompt change has broken the prefix. Write volume above the historical baseline means an upstream system is injecting new content. TTL miss rates above 20 percent mean the cache is churning more than it should. Each alert has a specific remediation that avoids weeks of silent drift. Setting them during the rollout rather than afterward is the right engineering discipline.

Looking ahead at ROI, the right number is blended cost per thousand turns, not the headline discount. A workload that cuts input cost by 80 percent but doubles write volume may save less. Only a blended metric catches that compound effect across tiers of traffic. The agent cost per task measurement playbook gives a complete worksheet to build this view. A clean monthly review of the blended number keeps the pricing conversation grounded for the team. Prompt caching ROI should always ladder up to that single blended figure for budget planning.

Common Mistakes Teams Make With Prompt Caching

Looking ahead at rollout pitfalls, most caching efforts hit the same four mistakes early. These mistakes are cheap to avoid once a team has seen them described in advance. The first is adding a dynamic value like a timestamp to the system prompt. That addition invalidates the cache every call without the team noticing. The fix is a quick prompt audit for anything that changes per request. Teams that skip this step report confused dashboards where writes are high and hits are zero. The fix is often a single-line edit to the system prompt template.

Turning to the second mistake, over-reliance on the long TTL tier is a quiet money sink. The 1 hour tier on Anthropic costs 200 percent of base input on write. A prefix needs more than two reads within the hour to come out ahead on that tier. Teams often opt into the long tier because it sounds safer than the short one. They then pay real money on quiet nights when traffic falls off sharply. Start on the short tier and confirm hit rate before any upgrade, and tokenization in LLMs with byte pair encoding covers how to size prefixes.

Beyond the top two mistakes, a third common error is mixing explicit and implicit caching without a single owner. A team using OpenAI implicit caching alongside Anthropic explicit markers produces two different behaviors. A/B comparisons across providers become misleading in that scenario because the two caches behave differently on identical traffic. Pick one pattern per workload and document it in the prompt template. The fourth mistake is skipping instrumentation entirely and discovering the cache is not firing from the invoice. A one hour investment in dashboards pays for itself in the first month.

Looking ahead at the fifth and subtler mistake, teams sometimes assume prompt caching replaces prompt engineering. In reality the two multiply each other, so a well-engineered prompt can be far cheaper. Treating prompts as versioned assets is one habit that separates great teams from average ones. Reviewing them for stability and monitoring hit rate as a KPI are the other two. The answer to what is prompt caching and how does it cut LLM costs is finally a question of disciplined engineering. Teams that treat it as a force multiplier on prompt discipline end up with the prompt caching returns they read about.

Key Insights Across Provider Pricing and Production Data

  • Anthropic cache reads bill at ten percent of base rate, the Introl caching infrastructure guide pins at thirty cents against three dollars uncached per million.
  • OpenAI prompt caching reduces cached tokens to fifty percent of base price on legacy models, a figure the OpenAI prompt caching guide drops further for newer endpoints.
  • DerivAI measured seventy seven percent reduction in input spend on a live customer service agent, the team documents in its production agent caching write-up with full metrics.
  • Google Gemini requires a minimum 1024 cached tokens plus hourly storage, a model the Vertex AI context cache docs describe as explicit cached_content resources.
  • Brian Moonspot reports lifting cache hit rate from zero to ninety two percent, a shift the production prompt caching write-up traces to moving three message blocks in the request.
  • Semantic caching research reports hit rates between sixty one and sixty nine percent, numbers the Don’t Break the Cache evaluation stress-tests across production corpora with 97 percent accuracy.
  • Prefix caching cuts time to first token by fifty to eighty five percent on long prompts, a finding the Introl infrastructure review attributes to removed prefill time.
  • Amazon Bedrock enforces a two-checkpoint caching model with thresholds at 1024 and 2048 tokens, a nuance the caching infrastructure guide flags as easy to miss.

Those numbers converge on a consistent picture across providers today. Cache reads consistently bill at a sharp fraction of the base input rate everywhere. Cache writes carry a modest premium on the longer tiers across every vendor. Production hit rates above 80 percent turn the pricing sheet into a decisive cost lever for teams. The research frontier of semantic caching extends the same economics to paraphrased queries. Teams that combine prefix and semantic caching can approach a theoretical cost ceiling of compute per new content.

Comparing Provider Pricing Side by Side

The side-by-side table below captures the pricing dimensions a team evaluates when picking a prompt caching provider. Each dimension matters differently depending on workload shape and expected cache hit rate. Read rates matter most when the application reuses prefixes aggressively across many requests. Write premiums matter more when the workload is bursty and prefixes churn frequently. Minimum prefix length decides whether shorter prompts can benefit from caching at all. TTL choice ties the economics to how long the traffic stream stays warm. Explicit markers give control, while implicit caching trades predictability for convenience across the stack.

DimensionAnthropic ClaudeOpenAI GPTGoogle GeminiAmazon Bedrock
Cache read rate10 percent of base50 percent legacy, 10 percent GPT-5.6+Discounted plus hourly storageVaries by model
Cache write premium125 percent short, 200 percent longNone legacy, 125 to 250 percent on tieredStorage fee onlyNo published premium
Minimum cacheable prefix1024 tokens1024 tokens1024 tokens1024 / 2048 tokens by checkpoint
Default TTL5 minutes, 1 hour option5 to 10 minutes idle, 1 hour maxDeveloper chosen hourlyShort default
Explicit versus implicitExplicit cache_control markersImplicit above 1024 tokensBoth modes supportedExplicit checkpoints
Latency reduction claimedUp to 85 percent on long promptsNot officially statedSignificant for repeat long contextsMirrors underlying Claude or Nova
Typical break-even reads1.4 short tier, 2.2 long tier1 on legacy modelsDepends on storage windowComparable to Anthropic

Real Examples of Prompt Caching in Production

The three implementations below show prompt caching deployed at production scale with concrete numbers for cost, latency, and tradeoffs.

DerivAI Customer Service Agent

DerivAI deployed Anthropic cache_control markers on the tool definitions and planning prompt of a production customer service agent handling thousands of daily sessions. The engineering team placed the cache breakpoint on the final tool block so the entire schema became a single cacheable prefix. Measured input spend fell 77 percent within one week after the rollout, and time to first token dropped by roughly 40 percent on cached turns. The limitation the team flagged was that the 5 minute TTL cooled down during low-traffic overnight hours, so morning requests paid write premium again. The full write-up including code examples sits in their production agent caching case study. The team ultimately added a synthetic keep-warm ping during off-hours to keep high-value prefixes resident. That change closed most of the overnight cost gap quickly.

Moonspot Development Assistant

Brian Moonspot deployed prompt caching on a Claude-powered development assistant that initially produced zero cache hits because the team embedded a request timestamp near the top of each system prompt. Moving that timestamp to the bottom of the user message raised the hit rate from 0 to 92 percent in two days total. Measured input spend dropped 78 percent on identical traffic volume after the restructuring completed. The limitation the team flagged was that larger prompt changes still forced a full warm-up period during rollout. During that warm-up the write premium applied to every call until hit rate recovered. The full breakdown sits in Moonspot’s prompt caching write-up that quantifies the shift request by request.

Anthropic Internal Claude Code Users

Anthropic deployed prompt caching for Claude Code users who routinely see 80 to 90 percent cost reduction on repeated development sessions. A single coding session can load a 40000 token repository state and then run 30 or more turns against it. That turns the write premium into a rounding error against the massive cached reads downstream, and latency drops into sub-second territory. The limitation the team flagged is that renaming a file or changing a dependency tree invalidates the cached prefix. Those changes trigger a full re-write on very large codebases, which is a real cost for the next few requests. These numbers have been corroborated by third-party developer writeups such as the Alejandro Rioja prompt caching guide. The pattern generalizes to any workload with a long stable context plus a long session.

Recommended by AIplusInfo

Books to go deeper on LLM internals and caching

Two practitioner-grade titles that cover the mechanics and production economics behind prompt caching.

As an Amazon Associate, AIplusInfo earns from qualifying purchases.

Hands-On Large Language Models: Language Understanding and Generation

Book

Hands-On Large Language Models: Language Understanding and Generation

The clearest practitioner tour of LLM internals, including the KV cache mechanics that make prompt caching work.

Buy on Amazon
Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications

Book

Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications

Chip Huyen's blueprint for production ML systems, including the cost, latency, and caching considerations behind LLM deployments.

Buy on Amazon

Case Studies Where Caching Reshaped Budget and Latency

Three documented rollouts illustrate how prompt caching reshaped engineering budgets and latency profiles at live production scale.

Case Study: TKMX AI Platform API Bill

TKMX AI documented a dramatic reshape of its API bill after a full prompt caching rollout across chat and agent surfaces. The problem the team faced was runaway input spend on Claude Sonnet during rapid growth phases. The stable system prompt accounted for roughly 60 percent of every call and traffic was growing 20 percent month over month. The solution was a disciplined prompt audit that split prompts into three layers for cache control. The measured impact was a 73 percent reduction in monthly Claude spend without changing the model tier. The team detailed the rollout in its reshaped our API bill writeup with full numbers. The limitation was that cache miss rate spiked by 15 percent for the first 48 hours after any prompt revision, which forced a staged rollout model.

Beyond the headline savings, the operational pattern the team adopted became the template for how they ship prompts. Every prompt change now goes through a canary that measures hit rate before full rollout. The team maintains a dashboard that tracks hit rate per prefix as a first-class SLO. The engineering lift was modest, a few days of work for a senior engineer. The payback was realized inside a single billing cycle on their Anthropic account. The team notes the biggest risk is complacency once the cache is working well. A monthly review of the hit rate ladder is the practice that keeps that from happening.

Case Study: Jangwook Kim Claude Pipeline

Jangwook Kim published a detailed breakdown of a production Claude pipeline that cut its API bill by 78 percent through prompt caching. The problem was that a 15000 token system prompt plus tool schema was being paid for on every one of 30 million monthly requests. That represented a six figure monthly cost on the Anthropic invoice alone. The solution was to attach explicit Anthropic cache_control markers to the system and tool blocks. The team re-architected the message history so volatile content stayed outside the cache boundary. The measured impact was a drop from low six figures to low five figures in month one, which the team walks through in its production caching breakdown. The limitation the team flagged was that gains concentrated in a narrow band of workloads with very long stable prefixes.

Beyond the raw savings, the engineering team made two specific choices worth lifting. First they standardized on the 5 minute TTL and used synthetic ping requests to keep top prefixes warm. That avoided paying the 200 percent write premium of the 1 hour tier. Second they instrumented cache hit rate per prefix and set an alert at 70 percent as a paging threshold. That alert caught two prompt regressions within the first quarter after rollout. The team also notes the biggest cultural shift was treating prompts like code with reviews and tests. Prompt caching made that discipline pay for itself immediately rather than later.

Case Study: LMCache Self-Hosted vLLM Deployment

Teams running self-hosted inference on vLLM face a different version of the same prompt caching problem. The problem a representative LMCache user faced was end-to-end latency averaging 4 seconds on long-prompt chat workloads. That latency made the product feel sluggish to end users and hurt retention metrics. The solution was to attach the LMCache layer to a vLLM deployment with a shared key-value store. The measured impact was a 3 to 10 times reduction in time to first token depending on prefix length. The Introl caching infrastructure review benchmarks those results in detail. The limitation the team flagged was that the shared store must sit on a fast network because round trip time dominates below prefill break-even.

Beyond raw latency, the self-hosted case brought up a cost model that provider-hosted teams rarely encounter. The team found that a modest 128 gigabyte cache per node held enough prefixes for 90 percent of production traffic. That translated into a measurable hardware commitment rather than a line on an invoice. The decision framework became a break-even between GPU time saved and amortized storage cost. On busy workloads the hit was decisive and the team expanded storage allocations. On quieter workloads the team sized down the cache rather than remove it entirely. The engineering lift was heavier than a provider-hosted rollout but still justified it.

Frequently Asked Questions About Prompt Caching and LLM Costs

What is prompt caching in simple language?

Prompt caching is a server-side feature that stores the computed attention state of a reusable prompt prefix. Later requests that share the same prefix reuse that state instead of recomputing it. The reused tokens bill at a reduced cache read rate. This saves both cost and latency on long repeated prompts.

How much can prompt caching reduce LLM costs in practice?

Documented production savings range from 50 percent on OpenAI legacy caches to 90 percent on Anthropic with stable long prompts. DerivAI measured 77 percent cuts on its agent, and Moonspot reported 78 percent after a two-day restructuring. Actual savings depend on cache hit rate and the share of the request that sits in the stable prefix.

Which providers support prompt caching in 2026?

Anthropic, OpenAI, Google Gemini, Amazon Bedrock, DeepSeek, and xAI Grok all offer prompt caching with slightly different interfaces. Anthropic uses explicit cache_control markers placed on specific message blocks in the request body. OpenAI caches automatically above 1024 tokens with an optional prompt_cache_key hint. Gemini supports both implicit caching on repeated prefixes and explicit cached_content resources for long documents.

What is the minimum prompt length for caching to work?

All four major providers set a floor of about 1024 cacheable tokens in the prefix. Shorter prompts are ignored by the cache layer entirely and bill at the full rate. Amazon Bedrock uses a two-checkpoint model requiring 1024 and 2048 tokens. Teams whose system prompts are under the floor must lengthen or restructure before caching pays off.

How long does a cached prompt live before expiration?

Anthropic defaults to a 5 minute TTL that refreshes on every hit, with an optional 1 hour tier. OpenAI legacy caches live 5 to 10 minutes idle, up to one hour total. Gemini explicit caches accept developer-chosen hourly windows with storage fees. Each tier has different cost trade-offs on quiet traffic and on busy traffic.

How does prompt caching differ from traditional response caching?

Response caching stores full model answers keyed by exact input. Prompt caching stores computed attention state for a prompt prefix regardless of the final answer. Response caches hit only on identical questions, while prompt caches hit on any request that shares the stable prefix. The two can be stacked for even higher hit rates.

What is the break-even point for prompt caching?

Break-even depends on the cache write premium and the read discount. Anthropic 5 minute tier breaks even near 1.4 reads per write, and the 1 hour tier breaks even near 2.2 reads. OpenAI legacy caches break even on the first read because they carry no write premium. Monitoring hit rate per prefix catches low-ROI caches early and before they accumulate real spend.

What are the biggest risks of prompt caching for production apps?

The top risks are stale cached instructions that no longer reflect the latest policy, cost overruns from caching ephemeral content, and cross-tenant leakage if cache keys are shared across users. Teams mitigate these by versioning prompts, scoping cache keys per tenant, and monitoring hit rate per prefix. A written cache policy helps teams stay aligned across engineering, security, and product reviews.

Does prompt caching reduce latency as well as cost?

Yes, prompt caching eliminates the prefill step for cached tokens. Providers report 50 to 85 percent reductions in time to first token on long prompts. Self-hosted vLLM users measure 3 to 10 times latency reductions with LMCache. The latency gain is often more valuable than the cost gain for user-facing products.

Can prompt caching leak information across tenants?

Caches are organization-scoped at every major provider, so there is no cross-organization leakage. The risk sits within an organization that shares a cache key across tenants or users. The safe default is to scope cache keys per tenant, accept a lower aggregate hit rate, and audit telemetry that may expose cache contents.

Should I use the short or long cache TTL tier?

Most teams should start on the short tier because it has the lower write premium. The long tier pays off only when measured traffic shows at least two reads within the hour for the same prefix. Running both in parallel for a week gives the cleanest empirical answer. Switching to the long tier should be a measured decision.

How does semantic caching extend prompt caching?

Semantic caching uses embeddings to match paraphrased queries rather than exact prefixes. Research systems like GPTCache and SCALM report 61 to 69 percent hit rates and 97 percent accuracy on query workloads. Stacking semantic caching on top of prefix caching can push total hit rate well above 90 percent. The approach is still maturing in production environments but shows strong early benchmark results.

What metrics should I monitor on a prompt caching rollout?

Monitor cache hit rate per prefix, write volume per prefix, cache read tokens versus write tokens, and time to first token on hit and miss. Set alerts at 50 percent hit rate, abnormal write spikes, and high TTL miss rates. A monthly review of the blended cost per thousand turns keeps the pricing narrative honest.