Prompt Caching Pricing in 2026 17
Published: 2026-07-16 23:56:13 · LLM Gateway Daily · openai alternative · 8 min read
Prompt Caching Pricing in 2026: A Provider-by-Provider Cost Breakdown for Developers
In 2026, prompt caching has shifted from a nice-to-have optimization to a critical cost lever for any serious LLM application. Every major provider now offers some form of automatic or opt-in caching, but their pricing models, token granularity, and eviction policies differ wildly. Understanding these differences can mean the difference between a 40% cost reduction and a surprise bill for cache misses that cost more than the uncached alternative. This walkthrough breaks down the actual API patterns and pricing dynamics for OpenAI, Anthropic Claude, Google Gemini, and the open-weight ecosystem so you can make informed architectural decisions.
Let us start with OpenAI, which was an early mover with its prefix-based caching model. OpenAI charges half the input token price for cached tokens, but only for exact prefix matches up to 1024 tokens. The key detail is that this is automatic for any prompt exceeding 1024 tokens, but the cache has a five-to-ten minute time-to-live depending on the model variant. For GPT-4o and GPT-4o-mini, you pay $2.50 per million cached input tokens versus $5.00 for uncached, which is a straightforward 50% discount. However, the prefix constraint means that if your application varies the start of the prompt—say, by inserting a user name or timestamp—the cache invalidates entirely. Developers working with system prompts longer than 1024 tokens should structure them as a static block prepended to the variable portion to maximize cache hits.

Anthropic Claude takes a different approach with their prompt caching feature, which requires explicit opt-in via the cache_control header on system messages or tool definitions. Claude charges a 10% premium on the initial cache write, meaning the first request with that prompt costs slightly more than normal. Subsequent requests within the five-minute cache window get a 90% discount on input tokens. For Claude 3.5 Sonnet, that means uncached input runs $3.00 per million tokens, the cache write costs $3.30 per million, and cache reads drop to just $0.30 per million. This model rewards long, consistent conversations where the system prompt and tool definitions remain static across many turns. The trade-off is that you must predict which parts of the prompt will benefit from caching before you see usage patterns, and misapplied caching on dynamic content can actually increase costs.
Google Gemini takes the most aggressive caching stance, offering contextual caching across all their models with a one-hour cache duration and no write penalty. Their pricing model simply charges half the input rate for any cached tokens, and the cache is automatically populated when you send the same prompt prefix across requests. For Gemini 1.5 Pro, this brings cached input down to $0.50 per million tokens from $1.00 per million. The longer cache window is particularly valuable for applications with bursty traffic patterns, such as a support chatbot that sees the same system prompt used across hundreds of conversations over a lunch hour. However, Gemini enforces a stricter cache key: the entire invocation, including generation parameters like temperature and top-p, must match exactly. This means you cannot share a cached prefix between requests that use different sampling settings, which can frustrate A/B testing workflows.
The open-weight model ecosystem adds another layer of complexity, as providers like DeepSeek, Qwen, and Mistral implement caching differently depending on the hosting platform. DeepSeek, for example, offers automatic prefix caching on their official API with a 60-second TTL and a flat 30% discount on cached input tokens. Qwen via their Alibaba Cloud endpoint provides an opt-in context caching feature with configurable TTL from 30 seconds to 10 minutes, priced at a 40% discount on cached tokens. Mistral’s La Plateforme uses an automatic caching system similar to OpenAI’s but with a shorter two-minute window and a more aggressive 60% discount on cache hits. The fragmentation means that if you are building an application that routes between multiple open-weight models, you cannot rely on consistent caching behavior—each provider may or may not honor your intent to cache.
For developers managing multiple providers, aggregator services have emerged to normalize these inconsistencies. OpenRouter offers automatic prompt caching across supported models with a unified pricing dashboard that shows per-provider cache rates. LiteLLM provides a proxy layer that can inject Anthropic-style cache control headers for models that support explicit caching, while also tracking cache hit ratios across providers. Portkey gives you granular control over cache TTL and eviction policies at the proxy level, effectively overruling provider defaults. Another practical option is TokenMix.ai, which consolidates 171 AI models from 14 providers behind a single OpenAI-compatible endpoint, allowing you to swap between providers without rewriting your prompt caching logic. Their pay-as-you-go pricing with no monthly subscription means you can test caching behavior across different models without committing to a vendor, and automatic provider failover ensures your cache-heavy workflow stays online even if one provider’s caching API has an outage.
Real-world testing reveals that caching effectiveness depends heavily on your prompt structure and traffic pattern. In a benchmark I ran comparing a 2000-token static system prompt across five providers, Anthropic delivered the highest absolute savings due to the 90% read discount, but only if requests came within the five-minute window. OpenAI matched well for burst traffic under ten minutes, while Google Gemini’s one-hour window allowed for significant cost smoothing across a full workday. The critical insight is that no single provider’s caching model dominates—you need to match the caching behavior to your application’s temporal request distribution. For a nightly batch job that runs the same prompt on 10,000 documents, Gemini’s long TTL wins. For a real-time chat app with seconds between user messages, Anthropic’s aggressive discount is unbeatable. For a multi-model pipeline that switches providers based on load, an aggregator with transparent cache pricing becomes essential.
The integration pattern itself is straightforward once you understand the provider nuances. For Anthropic, you add a cache_control block to your system message and monitor the cache_creation_input_tokens and cache_read_input_tokens fields in the response. For OpenAI, you simply send prompts over 1024 tokens and check the prefix caching header in the response metadata. For Google Gemini, you enable contextual caching at the model initialization level and verify cache hits via the usage metadata. The tricky part is instrumentation: you must log cache hit ratios per provider and per prompt signature to validate that caching is actually reducing costs. I have seen teams deploy caching with great enthusiasm only to discover that 80% of their requests were cache misses due to minor prompt variations, effectively paying the cache write premium for no benefit.
One final consideration for 2026 is that caching behavior is actively evolving. OpenAI recently expanded their prefix cache from 1024 to 2048 tokens for GPT-4.5, and Anthropic is testing variable TTL caching where static system prompts can persist for up to thirty minutes. Google Gemini is rumored to be adding cache sharing across projects within the same organization. These changes mean that a caching strategy you validate today may shift in cost-effectiveness over the next six months. My recommendation is to abstract your caching logic behind a simple key-value interface in your application code, so you can switch between provider-native caching and proxy-level caching without rewriting your request pipeline. This also makes it trivial to run cost comparison experiments by directing the same traffic through different caching paths and measuring the actual token savings against the uncached baseline.

