Title: Gemini 4 removes explicit context caching: my per-call cost goes up 4× with no way to control it

We run a document-heavy assessment pipeline on the Gemini API. Each job sends the same large corpus to many batch calls. On Gemini 3.8 Flash, explicit context caching means we upload the documents once and every batch reuses them at the cached rate.

We tested Gemini 4 Hydrogen on the same pipeline and the same documents:

  • Creating the cache fails: 400 INVALID_ARGUMENT: Explicit caching is not supported for models/gemini-4-hydrogen.
  • The caching docs confirm explicit caching “is not supported… for Gemini 4 models”. They give no reason, no alternative with guaranteed behaviour, and no roadmap.
  • Implicit caching covered about 4% of our input tokens on one lens: 0.9M cached out of 22.6M.
  • Cost per call: $0.23 on 3.8 Flash, $0.88 on Hydrogen, at the same list price.

The issue is control. With explicit caching we decide what is cached and know what we will pay. With implicit caching, Google decides, the docs promise only “cost savings… when a request hits the cache”, and the discount rate is no longer published.

This matters more because of how 3.7 Flash was retired: the endpoint now silently routes to 3.8 Flash. If 3.8 Flash is routed to a Gemini 4 model the same way, every production pipeline built on explicit caching loses it with no code change and no error, just a bill several times larger.

Google needs to restore:

  1. Explicit context caching on Gemini 4 models, or an equivalent with guaranteed hits (not ‘best effort’).
  2. The published discount rate and hit rules for implicit caching.
  3. No silent routing of a model that supports explicit caching to one that doesn’t, and advance notice before any routing change.
  4. A clear statement of how long 3.8 Flash will support explicit caching.

If anyone has a way around this, I’m all ears.

With only 4% of input cached, it might be worth checking the prompt order. Implicit caching only matches on the prefix, so the corpus has to be the very first thing in every request and exactly the same each time, with the per-batch instructions after it. The caching docs also say hits are more likely when requests with the same prefix go out close together, so sending the batch calls back to back may help. You can watch usage.total_cached_tokens per call to see if it moves.

Hello @fidiasd99f

Thanks for the detailed report. Gemini 4 models (gemini-4-hydrogen, gemini-4-argon, and gemini-4-carbon) use implicit caching only and do not support cachedContents. Implicit caching runs automatically on prompts of at least 4,096 tokens and discounts cached input tokens by 95% on cache hits, though hits are best-effort rather than guaranteed even with a shared prefix. In generateContent, cached counts appear under usageMetadata.cachedContentTokenCount (usage.total_cached_tokens is for the Interactions API).

For predictable per-call caching today, we recommend staying on gemini-3.8-flash (gemini-3.8-flash has introductory pricing through December 31, 2026, while gemini-4-hydrogen uses standard rates). For async jobs on gemini-4-hydrogen, the Batch API (batchGenerateContent) offers a 50% discount with a 24-hour target turnaround.

gemini-3.8-flash is a Stable model with no shutdown date or automatic routing announced. Deprecations, shutdowns, and cross-generation routing migrations (with migration guides for breaking changes) are announced ahead of time in our release notes and deprecations documentation.

References: