A technical and economic guide to LLM prompt caching — how KV cache reuse works, provider-specific implementations across Anthropic and OpenAI, and the breakpoint analysis for static system prompt ROI.

Every LLM API call processes input tokens through the attention mechanism, building a Key-Value (KV) cache that represents each token's relationship to every other token in the context. For a 10,000-token system prompt, the GPU must compute this cache from scratch on every call — even when the system prompt is identical across 100,000 requests.
Prompt caching solves this by persisting the KV cache for repeated input prefixes. When your next request begins with an identical prefix, the provider serves the cached KV representation rather than recomputing it, charging a fraction of the standard input rate.
For the full AI cost optimization landscape, see our sovereign tech and AI computing cost framework.
| Provider | Cache Minimum | Cached Input Rate | Standard Rate | Discount |
|---|---|---|---|---|
| Anthropic Claude | 1,024 tokens | $0.30 / 1M | $3.00 / 1M | 90% |
| OpenAI GPT-4o | 1,024 tokens | $1.25 / 1M | $2.50 / 1M | 50% |
| Google Gemini 1.5 | Varies | Context-dependent | $1.25 / 1M | Variable |
Anthropic cache writes: Writing a new cache entry costs $3.75 per 1M tokens (25% above standard). This write cost is amortized over subsequent reads.
Scenario: 8,000-token system prompt, 200-token user query, 400-token response.
Anthropic Claude 3.5 — No caching:
With caching (after first cache write):
Savings per call after breakeven: $0.0216 (70.6% reduction)
Cache write pays for itself after: $0.0366 / $0.0216 = 1.69 calls — essentially the very first reuse is profitable.
At 100,000 calls/month: $306/month without caching → $900/month first call + $89,999 × $0.009 = $900 total → $906/month ← Wait, recalculate clean:
Without caching: 100,000 × $0.0306 = $3,060/month With caching (1 write + 99,999 reads): $0.0366 + (99,999 × $0.009) = $900.03/month Monthly savings: $2,159.97 (70.6% reduction)
1. Stable prefix structure: The system prompt must appear at the beginning of the messages array, before any dynamic content. Any modification to the cached prefix — even a single character — invalidates the cache entry.
2. Freshness window: Anthropic caches expire after 5 minutes without use. Ensure your application traffic rate is sufficient to keep the cache warm between requests.
3. Explicit cache_control markers (Anthropic): You must mark prefix boundaries with "cache_control": {"type": "ephemeral"} in your API request. Without this, caching is not applied.
4. Temperature and sampling parameters: Caching applies to the input side only — sampled outputs remain stochastic. Cached prefixes do not affect output quality or determinism.
Use the LLM Token Cost Calculator to model your system prompt length and call volume to calculate your specific monthly caching savings.
No. Prompt caching only affects how the model processes input tokens — the KV cache representation is mathematically identical to a freshly computed cache. Responses generated using cached prompts are indistinguishable from responses generated without caching. The sampled output tokens are always generated fresh from the cached context, preserving full stochasticity and output quality.
Anthropic's prompt cache has a 5-minute time-to-live (TTL) that resets with each use. If your application sends at least one request every 5 minutes referencing the cached prefix, the cache remains active indefinitely. For low-traffic applications, cache misses will occur more frequently and you'll pay more cache write fees. High-traffic applications (> 12 requests/hour) effectively keep the cache continuously warm.
Yes. Both OpenAI and Anthropic support caching of multi-turn conversation history up to the cache point. In a customer support application where a 20-turn conversation accumulates 15,000 tokens of history, you can cache the entire conversation up to the most recent turn, paying only standard rates for the last message. This is particularly valuable for long-running agent sessions and multi-step workflows.
Any change to the cached prefix invalidates the entire cache entry, and you pay a full write fee to establish the new cache. For prompts with dynamic sections (e.g., user-specific context), structure your messages so the static portion appears first as the cacheable prefix, and dynamic content appears after the cache break point. This preserves the maximum cacheable prefix length while accommodating per-request variability.

Europe is moving forward with its ambitious Envision mission to Venus, despite a setback from NASA.

Prolonged laptop use has been linked to a range of health risks, including myopia, headaches, and eye strain.

Apple Watch listening features explained: data privacy, security, and how to use them safely.
Contextual evidence and verified documentation referenced in this research guide
Groundwork enforces a strict, independent verification standard. All claims and benchmark figures in this guide are cross-referenced against the primary documentation and regulatory registries listed below:
Elena Vasquez (2026). LLM prompt caching: How to cut API costs 40–90% with prefix caching. Groundwork. Retrieved from https://gworky.com/article/llm-prompt-caching-cost-reduction-guide
Originally published at https://gworky.com/article/llm-prompt-caching-cost-reduction-guide — Groundwork Evidence-Based Research.
Uncover forgotten seat licenses, redundant cloud services, and recurring overhead.
Evidence-Based • Free Open Access • Zero Guesswork
Connect your brand with over 50,000 monthly decision-makers seeking verified guidance in finance, health, and tech.
Compare estimated monthly cost across leading AI models based on your token usage.
tech
tech
tech
techEvaluated for performance, privacy protocols, and pricing transparency.
| Solution | Key Benchmark | Pricing | Verdict & Access |
|---|---|---|---|
NordVPNEditor Pick via Nord Security | Audited WireGuard no-logs protocol | $3.39/mo | |
ExpressVPN via Express Technologies | Lightway protocol, RAM-only servers | $6.67/mo | |
Cloudflare WARP+ via Cloudflare Inc. | Fast Argo edge routing | $4.99/mo | Reference Benchmark |
Smart Home & Digital Privacy Analyst
Smart home and digital privacy analyst focused on data ownership, device security, and power efficiency of AI utilities and gadgets.
This guide underwent secondary data verification to confirm primary source integrity, calculation formulas, and regulatory compliance before publication.