Guides / prompt cache cost calculator

Prompt cache cost calculator

This prompt cache cost calculator takes your shared prefix size and the number of calls that land inside one cache window, then prices the cached path against the uncached one. Culpa, a local-first LLM cost, margin, and forecast ledger, computes both in exact decimal, so you can see whether the write premium earns itself back on your own traffic.

Computed in your browser, in exact decimal

No caching$1.0000
Cached, 5m window$0.6750

Caching saves$0.3250 (32.5%)

Every one of these calls has to land inside the window for this to hold. Calls that arrive later pay the write premium again.

Rates come from Culpa's price book, effective 2026-07-02. Every figure is computed in exact decimal rather than floating point, which is why totals here match an invoice to the cent. Cost is calculated, not provider-reported: it prices the tokens you enter at a published rate.

Why this happens

The input that decides this answer is the one people get wrong. Caching gets evaluated on how many calls share a prefix, and the arithmetic only cares how many of them arrive close enough together to hit a live entry. So the field above asks for calls inside one window rather than calls a month, and entering a monthly figure there reports a triumph on an endpoint that may be losing money. A five-minute entry needs a second call before the write premium is repaid, and a one-hour entry needs a third.

What this usually looks like

  • Your caching decision was made on monthly call volume.
  • Nobody has grouped your calls by arrival time inside a window.
  • Caching is on everywhere by default rather than chosen per endpoint.
  • Cache write charges sit close to your total call count on the invoice.

Free, no card, no account

Run the free Cost Leak Scan

It shows your most expensive conversation before you install anything.

Run a free scan

Mistakes that cost the most

MistakeWhy it hurtsDo instead
Entering monthly call volume into a per-window question.It turns a losing endpoint into a spectacular saving on paper and changes nothing in reality.Count calls sharing a prefix inside one window, then enter that number.
Picking the one-hour window because it sounds safer.The write premium doubles, so it takes a third call rather than a second to break even.Try both above. The calculator prices the premium either way.
Treating one answer as covering every endpoint.Arrival patterns vary between endpoints far more than prefix sizes do.Run it per endpoint. The losing ones are usually the quiet, spread-out ones.

Run this check tonight

  1. Pick one endpoint and count calls sharing a prefix in a busy five-minute window.
  2. Enter that count above with your real prefix size.
  3. If the result comes back a loss, switch caching off for that endpoint.
  4. Try the one-hour window and see whether it turns the answer around.
  5. Repeat on your quietest endpoint, which is where caching usually loses.

One prefix, three arrival patterns

Illustrative example

A 50,000-token shared prefix on Claude Sonnet 5 at a real rate of $2.00 per million input, effective 2026-07-02. Anthropic bills cache reads at 0.10 times input and five-minute writes at 1.25 times. Arrival patterns are modelled.

Uncached, per call: 50,000 x $2.00 per million = $0.1000
Five-minute write: 50,000 x $2.50 per million = $0.1250
Cached read: 50,000 x $0.20 per million = $0.0100
One call in the window: $0.1250 cached against $0.1000 uncached, so caching loses $0.0250
Two calls: $0.1250 + $0.0100 = $0.1350 against $0.2000, so caching saves $0.0650
Ten calls: $0.1250 + (9 x $0.0100) = $0.2150 against $1.0000, a 78.5% saving

One call and caching is a 25% surcharge. Two calls and it saves 32.5%. The whole decision turns on a number most teams have never counted.

Every number, with its confidence and source

FigureWhat it meansConfidenceSource
2 callscalls inside one five-minute window at which caching starts to paycalculatedA write costs 1.25 times input and a read 0.10 times, so M = 1.25 + (M - 1) x 0.10 solves to M = 1.28. Anthropic's multipliers from the price book, effective 2026-07-02.
$0.1350 to $1.0000modelled monthly cost of one prefix across the teardown's arrival patterns, cheapest to dearestestimatedEndpoints from the teardown arithmetic at a real Claude Sonnet 5 rate. A range because the arrival patterns are modelled.

What a generic answer can’t know

A provider bills the writes and the reads and never reports which of your calls could have shared a window. That needs your own timestamps grouped by prefix, endpoint by endpoint. Culpa measures them on your infrastructure, keeps your prompts and responses there, and counts the calls to run your plan.

Questions founders ask next

What number goes in the calls field?

Calls sharing the same prefix that arrive inside one cache window, so within five minutes of each other on the short entry. A monthly total belongs nowhere near this field, and one sitting there explains most caching estimates that come out wrong.

Why does the calculator only offer Anthropic models?

Because those are the cache write rates Culpa's price book carries. OpenAI's GPT-5.6 family also charges to create a cache as of 2026-08-02 and the book has yet to seed those rates, while Gemini bills caching by storage time rather than by written tokens, which sits outside token accounting.

Does a bigger prefix change the break-even?

No. The break-even is a ratio between the write premium and the read discount, so it lands at two calls on a five-minute entry whatever the prefix size. A bigger prefix changes how much you win or lose, not which side of the line you land on.

On your infrastructure

Culpa runs on your infrastructure. Your prompts and responses never leave it. Culpa counts calls to run your plan, and it fails open, so if it ever breaks your app keeps running.


How Culpa works

Find the culprit. Not just the total.

Your dashboard shows what you spent. It stops short of who spent it. Culpa shows the conversation, the user and the feature behind it.

Your prompts stay local.

Culpa runs on your own infrastructure. What you send to a model reaches us at no point.

Every dollar has a name.

Follow any charge to the conversation, the user, the feature and the customer behind it.

See the bill before it lands.

Cost your next feature before you ship it. You get the likely bill and the worst case, at best, median, p90 and p99.

Three steps to your first answer.

1

Change one base URL.

Or drop in the Python or TypeScript library.

2

Find your most expensive conversation.

In the first session, not the first week.

3

Cost your next feature before you ship it.

Base URLhttp://localhost:4545/v1Your traffic keeps flowing if Culpa ever stops.

Why the bill went up

Example dashboard

Calls traced

418,209

across 3 projects

Spend this week

$378.41

+ $182 vs last week

Failed calls

312

74% retried, and you paid for all of them

+ $182 this week traced to one culprit

Spend over 14 days

$0$20$40$60$8024262830020406
user_384report_generatorconv_91fprompt_v1894,220 tokens3 retries$6.81

Most expensive users

user_384$38.42
user_119$21.07
user_562$14.90
user_204$8.30
user_871$5.10

Next week forecast

Best$180
Median$240
p90$310
p99$395

Graded against reality. Accuracy shown as results land.

Free, no card, no account

Run the free Cost Leak Scan

It shows your most expensive conversation before you install anything.

Run a free scan

Keep reading


Sources: Anthropic pricing. Last reviewed 2026-08-02. Plain text version.