LLM Prompt Caching Savings Calculator — OpenAI, Anthropic & Gemini

Enter your shared prompt, per-request tokens, and traffic to see what caching saves on each API and how often the cache needs to hit.

Request profile

Count the identical prefix that appears before the dynamic portion of a request.

Include billable reasoning tokens.

0–95% of requests reuse the prefix.

Example loaded · 8,192 shared tokens, 2,500 requests/day, 75% hits.

Rates and minimum cache lengths

Standard text API rates in USD per million tokens, checked November 25, 2026.

OpenAI and Gemini use implicit caching here. Anthropic charges for a 5-minute cache write on each eligible miss.

Costs and savings

USD · 30-day month · annual savings at 12× monthly

Turn these savings into a budget

Bring your monthly API estimate to BudgetHub’s infrastructure budget template to plan spending across your AI stack.

Explore BudgetHub

Method & FAQ

What counts as a cache hit?

The hit rate is the share of requests that reuse the same eligible prefix. Dynamic input and billable output use regular rates. A prefix below the provider’s minimum yields zero savings, and GPT-5 mini cacheable tokens are floored to a 128-token boundary. OpenAI prompt caching guide.

How are baseline and cached costs calculated?

The baseline uses regular input and output pricing. The caching scenario splits eligible prefix tokens between cache reads on hits and regular input or 5-minute cache writes on misses. Monthly totals assume 30 days of traffic. Annual savings use 12 identical months, with the same rates and traffic.

How is the break-even hit rate calculated?

The threshold is the miss-rate premium over regular input divided by the difference between the miss and cache-read token rates. A 0% threshold means the first cache hit saves money. N/A means there is no eligible prefix or there are no requests.

Which API charges are included?

The calculator uses published standard text token rates for one model per provider. It models implicit caching for GPT-5 mini and Gemini 4 Neon, and 5-minute prompt caching for Claude Sonnet 4.6. Taxes, tools, explicit Gemini cache storage, and contract discounts are outside this estimate. Gemini context caching guide.