buymeatokens

Gemini 4 Durable Implicit Caching and Token Costs

Understand the Gemini 4 SSD cache change and measure reuse across hours using the API’s cached token counts.

By the buymeatokens team1 min read

Short answer

Gemini 4 can retain evicted implicit cache prefixes on encrypted SSD for up to 12 hours without an extra storage fee.

On this page
  1. Put repeated material at the beginning
  2. Calculate what a hit is worth
  3. Run a test at your normal request intervals
  4. Frequently asked questions

Google’s December 4 update lets Gemini 4 retain evicted implicit cache prefixes on encrypted SSD for up to 12 hours. This extends the opportunity to reuse a repeated prefix. The change has no additional storage fee. Projects with an approved zero data retention exception continue to use in-memory caching. Gemini API release notes

Put repeated material at the beginning

Use a stable prefix for your policy manual, tool schemas, or common code context. Append request-specific details afterward. Google lists a 4,096-token minimum for Gemini 4 implicit caching. Compare reported cached tokens with total input tokens and keep per-model measurements. Even a timestamp near the beginning can break the shared portion of the prefix. Gemini context caching

Calculate what a hit is worth

At Gemini 4 Carbon’s standard rates, 25,000 fresh tokens cost $0.10. If a later request reuses 20,000 at $0.20 per million and sends 5,000 fresh at $4 per million, input comes to $0.024. Output is billed separately. Use observed cache hits for monthly estimates because retention and prefix matching affect whether a request gets the discount. Gemini API pricing

Run a test at your normal request intervals

Replay the same policy prompt at intervals that match production, such as a minute, an hour, and the next shift. Keep its prefix byte-for-byte stable and record cached counts at each interval. A nightly job that reappears after a day has a different reuse pattern from an assistant that serves the same prefix all afternoon. Track LLM token usage

Frequently asked questions

Do I need to create an SSD cache first?

Google describes the feature as implicit. Verify cache reuse in response metadata. Prompt caching explained

Is the cache guaranteed to last twelve hours?

Google says up to twelve hours. Use your own hit rate for forecasts.

What happens with an approved ZDR exception?

Those projects remain on in-memory caching according to the release notes.