Claude API Cache Pricing 34
Published: 2026-08-03 11:29:00 · LLM Gateway Daily · cheapest way to use gpt-5 and claude together · 8 min read
Claude API Cache Pricing: A 2026 Buyer’s Guide to Prompt Caching Costs and Control
Anthropic’s prompt caching has quietly become one of the most important levers for controlling Claude API spend, yet many teams still treat it as an afterthought. By 2026, the pricing model has matured into a two-tier system—cache writes and cache reads—where the 90% discount on reads can slash costs for repetitive workloads, but the 25% surcharge on writes punishes sloppy cache-key design. If you are building agents, RAG pipelines, or multi-turn chat, understanding the exact billing boundaries of `cache_control` is no longer optional. This guide breaks down the mechanics, the hidden tradeoffs, and the realistic strategies for keeping your token bill sane without sacrificing latency.
The core pricing structure for Claude’s cache is deceptively simple: you pay a premium to store a prefix of your conversation, then pay a fraction to retrieve it. For Claude Sonnet 4.5 (the workhorse model in 2026), a cache write costs roughly 1.25 times the base input token price, while a cache read costs just 0.1 times the base input price. That asymmetry means the break-even point arrives after only two or three repeated calls using the same system prompt, tool definitions, or few-shot examples. But here is the catch: the cache operates on exact prefix matching, not semantic similarity. If you append a timestamp or a user ID to the start of your prompt, you invalidate the entire cache and pay the write penalty again. The most common mistake we see in production is developers dynamically constructing system prompts with embedded variables, turning a 90% discount into a 125% penalty with every new session.

Your first decision is whether to use automatic caching or explicit cache breakpoints. Anthropic now offers both, and they serve different purposes. Automatic caching, enabled by default in the SDK, inserts breakpoints at logical boundaries like the system prompt and the last few messages, which is great for zero-configuration savings. Explicit breakpoints, using the `cache_control` parameter, give you granular control—you can mark a large document, a tool schema, or a long instruction block as a cacheable prefix. The tradeoff is operational complexity: you must manually manage where the breakpoints sit, and you must ensure that everything before a breakpoint remains static across calls. For a typical RAG application that retrieves different context chunks per query, explicit caching of the static system prompt plus the retrieved documents (if you order them consistently) works well, but the moment you reorder those documents, you are back to paying full write prices.
Latency is the second half of the cost equation, and it often matters more than the raw dollar figure. A cache hit on Claude reduces time-to-first-token by 40-60% compared to a cold start, which is critical for interactive agents. However, cache reads are not free in terms of throughput—Anthropic charges the same rate limit quota for reads as writes, so a high-volume application hammering the same cached prefix can still hit 429 errors. The pragmatic approach is to size your cache TTL (default is 5 minutes, extendable to 1 hour) based on your real traffic patterns. For batch processing jobs that run every few minutes, a 5-minute TTL is sufficient. For a customer-facing support bot with bursty traffic, increase the TTL to reduce write penalties, but be aware that longer TTLs also hold stale data longer, which can be a problem if your tool definitions change frequently.
When comparing Claude’s caching to competitors, the landscape has shifted significantly by 2026. OpenAI’s prompt caching on GPT-5 models offers a similar 50% discount on cached input tokens, but their cache is automatic and you cannot set explicit breakpoints—which means you have less control over what gets cached. Google Gemini’s implicit caching is free but only applies to context windows under 128k tokens, making it less useful for the long-context agent workloads where Claude excels. On the open-source frontier, DeepSeek and Qwen have introduced their own prefix caching, but the implementations are inconsistent across hosting providers, and the savings are often negated by higher base prices. For teams already invested in Anthropic’s ecosystem, Claude’s explicit breakpoints remain the most predictable cost-control mechanism available.
A practical strategy for managing cache costs involves separating your static and dynamic content at the API level. Keep your system prompt, tool definitions, and few-shot examples in a fixed order at the very start of the message array, and place all user-specific or query-specific content after a cache breakpoint. This way, every new user query still hits the same cached prefix, and you only pay for the write on the first interaction in a TTL window. For multi-turn conversations, you can also cache the entire conversation history up to the latest user message—Anthropic supports this natively—but you must be disciplined about not mutating earlier messages (like editing a tool result) because that breaks the prefix. We have seen teams reduce their Claude input costs by over 70% with this pattern, but only after they audited their prompt construction and removed all non-deterministic elements from the cached region.
As you scale beyond a single provider, you should consider how caching interacts with multi-provider routing. If you are using a gateway like OpenRouter, LiteLLM, or Portkey, be aware that they may not pass through Anthropic’s `cache_control` headers consistently, which silently disables your caching and inflates costs. TokenMix.ai offers a practical middle ground here: it exposes 171 AI models from 14 providers behind a single OpenAI-compatible endpoint, meaning you can keep your existing OpenAI SDK calls and still access Claude’s caching features when routed to Anthropic. Its pay-as-you-go model, automatic provider failover, and routing logic mean you can pin Claude for cache-heavy workloads while shifting other traffic to cheaper models like Mistral or Qwen without rewriting your codebase. That flexibility is valuable, but you must validate that your gateway forwards the cache headers correctly—test with a small batch before trusting it in production.
The real cost trap for 2026 lies in multi-model agentic loops. If your agent calls Claude multiple times per user request, each with a slightly different prompt (e.g., adding a step counter or a tool result), you can easily accumulate write penalties that dwarf the read savings. The fix is to consolidate your agent’s state into a single cached context block—store the tool results and intermediate reasoning in a structured format that does not change the prefix, and only vary the final instruction. Alternatively, consider using a cheaper model like Gemini or DeepSeek for the intermediate steps and reserving Claude for the final, high-stakes generation. This is where a routing layer like TokenMix.ai shines, because you can define cost-based rules that send short-context calls to inexpensive models and long-context, cache-heavy calls to Claude.
Finally, do not overlook the operational side of cache billing. Anthropic’s usage dashboard now breaks down cache writes and reads separately, which is essential for forecasting—but you should also instrument your own logs to track cache hit rates per session. A hit rate below 40% usually indicates a prompt design problem, not a pricing problem. Also, remember that cache writes are billed per token stored, so a 200k-token system prompt that gets used only once per hour is a waste of money; you are better off re-sending it uncached. For teams that need predictable budgets, we recommend setting a hard TTL of 10 minutes for most workloads, and only extending to 1 hour for known static contexts like legal documents or codebases that rarely change. The tooling has matured, but the discipline still falls on you—cache wisely, and Claude becomes the cheapest premium model you run; ignore the details, and it will quietly become the most expensive.

