Context caching — the 90% discount
If you're going to ask many questions against the same long context (a PDF, a codebase, a transcript), pay once to cache the context, then ask each question for ~10% of the per-token cost. Real numbers on Flash: $0.30/M for normal input → $0.03/M for cached input.
Minimum cacheable size
- Flash: 1,024 tokens minimum.
- Pro: 4,096 tokens minimum.
Below the minimum, caching is a no-op — you pay full input rate.
TTL is configurable
Default is 1 hour. Settable via ttl='300s' (or any duration string). The cache is billed per-token-hour, so a long TTL on a big context is its own cost. Match TTL to your actual reuse window.
File API for files that outlive a single call
Same File API as multimodal lessons. Files persist 48 hours, and you can attach them to multiple cache or generation calls during that window.