Prompt Cache Savings Calculator

Prompt caching lets a provider reuse a long, repeated prefix (instructions, documents, tool definitions) at a lower price when the next request starts with the same text. Enter the reusable prefix, the part that changes, the output, the number of requests and your hit rate, with the prices for plain input, cache reads and, if there is one, cache writes. You get the cost with and without caching, the savings and the break-even point. Cache rules differ by provider, so check the notes below.

Processed locally in your browser. Your data is not uploaded to our servers.

The part of the input that is identical across requests: system prompt, documents, tool definitions.

The part that changes every request, such as the user’s question.

Average reply size.

Total requests to price, for example one day or one month.

Share of requests that find the prefix already cached. Your assumption: it depends on traffic and the cache lifetime.

A preset fills in the price fields, including the cache-write price where the provider lists one. You can edit them.

What a cached prefix costs when it is read.

What writing the prefix to the cache costs on a miss. Leave empty to treat a write as normal input.

Preset prices are standard pay-as-you-go API prices in USD per million tokens, read from each provider’s pricing page and last verified 2026-10-19. Cache-write prices are the provider’s short-lived (5-minute) or short-context write price where one is listed. Storage fees are not included.

Price sources:

Result

Enter your tokens, requests, hit rate and prices to see the savings.

Exact arithmetic on your numbers, but the hit rate is an assumption and provider cache rules (lifetime, minimum size, storage fees, automatic or explicit caching) are not modelled.

Examples

Worked examples (10,000-token prefix, 500 non-cacheable and 300 output tokens, 1,000 requests, example prices of 3 input, 0.30 cache read, 3.75 cache write and 15 output per million tokens):

Hit rateWithout cachingWith cachingSavingsSavings (percent)
0%36.00 USD43.50 USD-7.50 USD-20.8%
50%36.00 USD26.25 USD9.75 USD27.1%
80%36.00 USD15.90 USD20.10 USD55.8%
100%36.00 USD9.00 USD27.00 USD75%

Formula & Methodology

The arithmetic is exact for the numbers you enter:

without caching = requests × (prefix + non-cacheable) × input price + requests × output × output price (each ÷ 1,000,000)with caching = requests × hit rate × prefix × read price + requests × (1 − hit rate) × prefix × write price + non-cacheable and output as abovesavings = without caching − with caching; savings % = savings ÷ without cachingbreak-even hit rate = (write price − input price) ÷ (write price − read price)

Good to know

  • Providers do not share one cache design. Some cache automatically, some need you to mark the prefix, some charge a write fee, some charge for storage by the hour, and lifetimes range from minutes to hours. Enter the prices and hit rate that match your provider.
  • Not modelled: cache lifetime and refresh, minimum cacheable size, storage fees, and any difference between several cache durations. A prefix that is not cached because it is too short earns no saving.
  • The prefix must be identical, token for token, at the start of the request. Changing the system prompt or reordering tools breaks the match and counts as a miss.
  • The hit rate is your assumption. A steady stream of requests usually keeps a short-lived cache warm; sparse traffic lets it expire.
  • Without a cache-write price the write is treated as normal input, which is how some providers bill it.

How to Use

  1. Enter the reusable prefix, the non-cacheable input and the output tokens, and the number of requests.
  2. Enter your expected cache hit rate.
  3. Enter the input, cache-read, optional cache-write and output prices, or prefill them from a preset.
  4. Read the cost with and without caching, the savings and the break-even point.

Frequently Asked Questions

How much does prompt caching save?

It depends on how much of each request is a repeated prefix and how often it is found in the cache. Cache reads are usually much cheaper than normal input, so a large repeated prefix with a high hit rate can cut input cost sharply. Enter your numbers to see the exact effect.

What is the cache hit rate?

The share of requests whose prefix is already in the cache. The first request after the cache expires is a miss. A hit rate of 80% means four in five requests read the cached prefix.

Why can caching cost more than not caching?

Some providers charge more to write a prefix to the cache than to send it as normal input. If the hit rate is low, you pay that premium often and read rarely. The break-even figures show the hit rate and the number of requests at which caching starts to pay off.

Do all providers cache the same way?

No. Cache lifetimes, minimum sizes, write fees, storage fees and whether caching is automatic all differ. This calculator uses the prices you enter and does not model those rules, so check your provider’s documentation.

What is the break-even point?

The hit rate at which caching costs exactly the same as no caching, and the number of requests that must reuse one written prefix for its write premium to be repaid. Above them, caching saves money.

Last updated: