Prompt Cache Calculator
Compare cache writes, reads, TTL expiry, and Batch API savings for repeated LLM calls.
How to use
Choose a model and cache TTL, then enter the stable prefix, variable input, output, and hourly call counts. Automatic mode estimates cache hits from evenly spaced call gaps; Manual mode uses your measured hit rate. Turn on Batch only when requests can run asynchronously.
The calculator treats the first eligible call as a cache write and shows later reads or rewrites in the timeline. Prefixes below the selected model's minimum stay uncached. Compare the first-hour scenarios and use break-even calls to decide whether the higher write price pays back before expiry.
FAQ
How is the cache hit rate estimated?
Automatic mode assumes calls are evenly spaced. The cold call writes the cache; later calls read it when the gap is no longer than the selected TTL, otherwise each call rewrites it.
What does break-even calls mean?
It is the minimum calls sharing one eligible prefix needed for cache write plus subsequent reads to cost no more than processing that prefix normally every time.
Can prompt caching and Batch API savings stack?
The combined scenario applies the selected model data for cache writes and reads, then applies its Batch multiplier when Batch is enabled.