Why it matters

Prompt caching cuts costs. Understanding shapes provider use.

Advertisement

The architecture

Cache eligible prefix.

TTL: 5 min typical.

Cost: cache reads much cheaper.

Prompt caching flowLong prompt prefixsystem + docsCache writefirst requestCache readlater requestsAnthropic + Google + OpenAI all offer; cache read ~10% of full prompt cost
Prompt caching.
Advertisement

How it works end to end

Anthropic: explicit cache_control markers.

OpenAI: automatic prefix caching.

Gemini: context caching.

Cost: cache read ~10-50% of miss.