Last updated: December 5, 2026
Gemini implicit caching automatically reuses repeated prompt prefixes and bills them at a 95% discount on Gemini 4 models. Since December 4, 2026, Gemini 4 can also keep evicted prefixes on encrypted SSD storage for up to 12 hours at no extra fee, which raises hit rates for prompts reused across a working day.
Contents
- What changed on December 4
- Models, minimums and discounts
- What cache hits cost
- How to get reliable cache hits
- What breaks the cache
- Multi-turn chats and agent loops
- Privacy, ZDR and store=false
- Gemini 4 versus Gemini 3 caching
- Limitations
- Frequently asked questions
What changed on December 4
Google’s December 4 release note adds durable implicit caching for Gemini 4 models (Gemini API release notes). Previously, implicit cache entries lived only in memory (RAM), and an evicted prefix meant paying the full input rate again.
Gemini 4 models may now store those evicted prefixes in encrypted durable storage (SSD) for up to 12 hours. Hits served from SSD get the same 95% cached input discount as in-memory hits, and Google charges no storage fee (Context caching docs). You do not need to change any code to benefit.
Models, minimums and discounts
Implicit caching is enabled by default on all Gemini 2.5 and newer models. The Interactions API and all Gemini 4 models support implicit caching only; explicit caches are still available for Gemini 3 and 2.5 through the generateContent API (Context caching docs).
| Model | Minimum input tokens | Cache discount | Durable SSD tier |
|---|---|---|---|
Gemini 4 Neon (gemini-4-neon) |
4,096 | 95% (all tiers) | Yes, up to 12 hours |
Gemini 4 Carbon (gemini-4-carbon) |
4,096 | 95% (all tiers) | Yes, up to 12 hours |
Gemini 4 Hydrogen (gemini-4-hydrogen) |
4,096 | 95% (all tiers) | Yes, up to 12 hours |
| Gemini 3.8 Flash and 3.6 Flash | 4,096 | 90% (all tiers) | No, RAM only |
| Gemini 3.1 Pro Preview | 4,096 | 90% Standard and Priority, 80% Flex and Batch | No, RAM only |
For model details, see our guides to Gemini 4 Neon and Gemini 4 Hydrogen.
What cache hits cost
Cached tokens are billed at a fraction of the normal input price. These are the paid-tier Standard rates per 1 million tokens in Google’s pricing page (Gemini API pricing):
| Model | Input | Cached input | Output (incl. thinking) |
|---|---|---|---|
| Gemini 4 Carbon | $4.00 | $0.20 | $20.00 |
| Gemini 4 Neon | $3.00 | $0.15 | $15.00 |
| Gemini 4 Hydrogen | $1.50 | $0.075 | $7.50 |
On the Batch tier, Gemini 4 Carbon costs $2.00 for input and $0.10 for cached input. Gemini 4 Hydrogen also has a free tier, while Carbon and Neon do not (Gemini API pricing). Our Gemini 4 Carbon pricing guide covers the December 1 price change.
A simple example using those rates: a 100,000-token prefix on Gemini 4 Neon costs $0.30 per request at the standard input rate, and $0.015 when it is fully cached. Durable storage does not change these prices; it only makes hits more likely.
How to get reliable cache hits
Follow these steps to structure requests so the cache can match them (Context caching docs):
- Use a Gemini 4 model such as
gemini-4-neonon the Interactions API, and make sure the shared prefix is longer than 4,096 tokens. - Keep
thinking_levelthe same for the whole session. It is serialized first, so changing it invalidates the entire prefix. - Keep the non-deferred
toolsarray fixed and in the same order. Tools are serialized beforesystem_instruction. - Keep
system_instructionstatic. Move timestamps, request IDs and user IDs into the final block ofinput. - Place uploaded file references and shared reference text before the variable question, in the same order on every call.
- On follow-ups with
previous_interaction_id, resend identicaltools,system_instructionandgeneration_config. That parameter persists conversation turns only. - Check
usage.total_cached_tokensagainstusage.total_input_tokensto measure your hit rate.
What breaks the cache
Google lists six avoidable changes behind most unexpected misses (Context caching docs):
| Change | What gets invalidated | Fix |
|---|---|---|
Changing thinking_level mid-session |
The whole prefix | One level per session, or separate workflows |
| Editing or reordering non-deferred tools | Tools, system instruction and all turns | Fixed tool order, or tool retrieval with defer_loading |
Timestamps or IDs in system_instruction |
System instruction and all turns | Put volatile data in the last user message |
| Reordering JSON keys or files | Everything after the first difference | Fixed key and file order |
| Omitting config on follow-ups | The prefix on every turn | Resend identical config |
Stripping thought or signature fields when store=false |
Turn replay and prefix matching | Append model steps unchanged |
Deferred tools are sorted alphabetically, so their order does not break the cache; see our Gemini tool retrieval guide. To change instructions mid-session safely, see Gemini mid-conversation system instructions.
Multi-turn chats and agent loops
On Gemini 4, every request recomputes a trailing 2,050-token window at the standard input rate. The full previous request is cached only when the new turn adds at least 2,050 tokens, counting model output, thinking, tool calls, tool results and the new user message (Context caching docs).
Google’s example: after a 10,000-token turn, a short chat follow-up that adds 400 tokens gets 7,950 cached tokens. An agent turn that adds 3,200 tokens of thoughts and tool results keeps all 10,000 tokens cached.
Privacy, ZDR and store=false
Durable cache data uses Google default encryption, stays isolated to your project and is never used to train models on Paid Services (Context caching docs). It is, however, data at rest for up to 12 hours.
Google’s zero data retention page states that projects with an approved ZDR exception are opted out of durable storage and remain on RAM-only caching (ZDR documentation). Setting store=false on the Interactions API opts out of server-side conversation storage, but implicit caching, including durable storage on Gemini 4, still applies (Context caching docs).
Gemini 4 versus Gemini 3 caching
| Item | Gemini 3 and earlier | Gemini 4 |
|---|---|---|
| Cache location | RAM only, up to 24 hours best effort | RAM, plus SSD for evicted prefixes up to 12 hours |
| Discount | Up to 90% | 95% on all tiers |
| Explicit caches | Supported on generateContent | Not supported |
| Storage fee for implicit cache | None | None |
To migrate from explicit cachedContents, remove cache lifecycle and TTL logic, move cached content into interactions.create with static content first, and switch to a Gemini 4 model (Context caching docs).
Limitations
- Implicit caching is opportunistic. Google offers no guaranteed retention window or guaranteed savings.
- Prompts under 4,096 tokens never cache. Deferring many tool schemas can push a medium request below that floor.
- The trailing 2,050-token window is always billed at the standard rate.
- Send requests that share a prefix close together in time; keep-alive requests do not guarantee retention.
Frequently asked questions
What is Gemini implicit caching?
Implicit caching is the Gemini API’s automatic reuse of matching prompt prefixes. It is on by default for Gemini 2.5 and newer models and bills matched tokens at the cached input rate, with no storage fees.
How long does the Gemini implicit cache last?
In-memory entries have a best-effort TTL of up to 24 hours. On Gemini 4, evicted prefixes may be kept on SSD for up to 12 hours. Neither window is guaranteed, because the server evicts entries based on capacity and request routing.
How do I know if I got a cache hit?
Read usage.total_cached_tokens in the Interactions API response and compare it with usage.total_input_tokens. On the older generateContent path, the field is usage_metadata.cached_content_token_count.
Can I turn off durable SSD caching?
Google’s documentation does not describe a per-request switch. Projects with an approved zero data retention exception are opted out and stay on RAM-only caching. Setting store to false on the Interactions API does not disable implicit or durable caching.
Why am I not getting cache hits?
Common causes are a prompt under 4,096 tokens, a changed thinking_level, edited or reordered tools, timestamps in the system instruction, and follow-up turns that omit tools or generation_config.
Sources
- Gemini API release notes, December 4, 2026 (Google AI Studio)
- Context caching (Gemini API documentation)
- Zero data retention in the Gemini Developer API (Gemini API documentation)
- Gemini Developer API pricing (Gemini API documentation)
Image: Google Gemini logo by Google LLC, public domain (trademarked), via Wikimedia Commons. Gemini is a trademark of Google LLC. FreeAnswers is not affiliated with Google.