API COST · PROMPT CACHING

Claude Cache Cost Calculator

Is 5 minutes enough, or is 1 hour cheaper?
Compare both with no caching.

Claude API cost inputs
Interval examples

Enter token counts only. No prompts or API keys. Calculation scope ↓

For these inputs, 1-hour caching costs the least. It saves $0.1500 compared with no caching.

No caching

$0.2820

All input billed at the standard rate

Cache writes
$0.0000
Cache reads
$0.0000
Uncached input
$0.2520
Output
$0.0300

5-minute caching

$0.3420

6 writes · 0 reads

Cache writes
$0.3000
Cache reads
$0.0000
Uncached input
$0.0120
Output
$0.0300

1-hour caching

Lowest cost

$0.1320

Cache writes: 1 · reads: 5

Cache writes
$0.0800
Cache reads
$0.0100
Uncached input
$0.0120
Output
$0.0300

Assumes sequential reuse of an identical prefix. Actual charges and cache hits are not guaranteed. Break-even analysis ↓

Cache writes and reads by request

Shows the first 20 requests. Totals include every request. Times are relative to the first request start.

Per-request breakdown · USD
RequestElapsed time5-minute caching1-hour caching
1 request0 minWrite · $0.0570Write · $0.0870
2 requests10 minWrite · $0.0570Read · $0.0090
3 requests20 minWrite · $0.0570Read · $0.0090
4 requests30 minWrite · $0.0570Read · $0.0090
5 requests40 minWrite · $0.0570Read · $0.0090
6 requests50 minWrite · $0.0570Read · $0.0090

NANOBOOK ANALYSIS · CALCULATED

When does Claude caching pay off?

Start with the gap between requests. In this fixed-prefix model, 5-minute caching becomes cheaper than no caching from request 2; 1-hour caching needs 3. Every reuse must arrive within the chosen cache lifetime.

Fixed study, independent of the calculator inputs above. Claude Sonnet 5.5 · 20,000 repeated + 1,000 new input + 500 output tokens per request. Cold start, USD before tax; no paid API or billing test.

Lowest-cost choice under this study’s equal-spacing assumptions
Gap between startsLowest-cost choiceWhat changes the answer
Under 5 minutes5-minute cache for 2+ requestsFor just 1 request, no caching is cheaper.
5 to under 60 minutes1-hour cache for 3+ requestsFor 1–2 requests, no caching is cheaper.
60 minutes or longerNo cachingBoth cache options rewrite on every request in this conservative model.

Two requests do not repay a 1-hour write

At a 10-minute gap, two requests cost $0.0960 with 1-hour caching versus $0.0940 without caching. With three requests, the comparison reverses: $0.1050 versus $0.1410.

The shared new-input and output costs cancel when comparing options. The initial cache-write premium and later prefix reads determine the break-even count.

Try 3 requests at a 10-minute gap
6 requests · 10-minute gapTotal USD, including new input and output
No cache
$0.2820
5m cache
$0.3420
1h cache
$0.1320

53.2% lower total cost with 1-hour caching here. A 95% discount on prefix reads does not mean the whole bill falls by 95%.

Explore the request-count × interval matrix 48 cases

Each cell shows the cheapest option and its total cost. Select a cell to load that exact workload into the calculator. None = no caching; 5m = 5-minute cache; 1h = 1-hour cache.

Claude Sonnet 5.5 · fixed token counts above · all requests included
Gap (min)1 request2 requests3 requests6 requests10 requests20 requests
1 minNone$0.04705m$0.06605m$0.07505m$0.10205m$0.13805m$0.2280
4.9 minNone$0.04705m$0.06605m$0.07505m$0.10205m$0.13805m$0.2280
5 minNone$0.0470None$0.09401h$0.10501h$0.13201h$0.16801h$0.2580
10 minNone$0.0470None$0.09401h$0.10501h$0.13201h$0.16801h$0.2580
30 minNone$0.0470None$0.09401h$0.10501h$0.13201h$0.16801h$0.2580
59.9 minNone$0.0470None$0.09401h$0.10501h$0.13201h$0.16801h$0.2580
60 minNone$0.0470None$0.0940None$0.1410None$0.2820None$0.4700None$0.9400
70 minNone$0.0470None$0.0940None$0.1410None$0.2820None$0.4700None$0.9400
Method, formulas and limits

Let N be the total request count, P the repeated-prefix tokens, U the new input tokens and O the output tokens. Let I, W, R and Q be the normal-input, chosen-TTL write, read and output rates in USD per million tokens.

No cache = N × [P × I + U × I + O × Q] ÷ 1,000,000

One write, then hits = [P × W + (N−1) × P × R + N × (U × I + O × Q)] ÷ 1,000,000

Strict savings when N > (W−R) ÷ (I−R), provided P is cacheable and I > R.

When each gap reaches or exceeds the TTL, this calculator charges a write for every request instead. Hits refresh the lifetime, so a session can last longer than 5 or 60 minutes without another write if every gap stays short enough.

The first strictly cheaper counts are 2 and 3 across all four supported models, including both Haiku 5.5 input-price tiers. They are total requests, including the cold write. Eligibility still depends on the model’s minimum cacheable prefix; these counts are not universal rules for other models or future prices.

  • The prefix and cache configuration stay identical. The first cache entry is available before reuse. Request starts are evenly spaced; new input and output counts stay constant.
  • At exactly 5 or 60 minutes, the model assumes a miss. Anthropic documents a minimum TTL and deletion that may take longer, so a real hit at or after that boundary is possible. Actual billing there is unverified.
  • Growing conversations, multiple breakpoints, mixed TTLs, prefix changes, parallel cold requests, provider failures and extra warm-up calls are outside this experiment. No latency improvement is measured.
  • The dataset compares 5 pricing variants across 48 workloads: 4 models, with a second tier for Haiku 5.5. The high-tier case uses 100,000 repeated + 1,000 new input tokens. Tokenizers differ, so equal token counts do not establish equal text length or model quality.

Totals are accumulated in integer nano-dollars. The downloadable file retains nine USD decimals; displayed costs are rounded. Every scenario row includes the model, inputs, write/read counts, rate version and assumptions.

Analysis checked · Derived from official Claude API pricing and prompt-caching rules. Numerical comparisons are NanoBook calculations, not observed API charges.

Download all 720 scenario rows (CSV)

Official rates used

Checked · Direct Claude API · standard processing · global rates · before tax. USD per million tokens.

Token rates and tiers for four supported models
ModelUncached inputOutput5-minute write1-hour writeCache readsMinimum prefix length
Claude Sonnet 5.5$2$10$2.5$4$0.1512 tokens
Claude Opus 5.5$4$20$5$8$0.2512 tokens
Claude Haiku 4.5$1$5$1.25$2$0.14,096 tokens
Claude Haiku 5.5Prompt up to 100,000 tokens$0.1$0.5$0.125$0.2$0.01512 tokens
Claude Haiku 5.5Prompt over 100,000 tokens$0.5$2.5$0.625$1$0.05512 tokens

Cache reads cost 5% of base input for Sonnet 5.5 and Opus 5.5, and 10% for Haiku 4.5 and 5.5. For Haiku 5.5, a prompt over 100,000 tokens uses the higher rates for all input, output, cache writes and cache reads. Prompt length includes the repeated prefix, new input and cache hits, but excludes output. Higher rates apply to the whole request, not just the tokens above the threshold.

What does this estimate assume?

Requests with an identical prefix

Assumes a cache breakpoint at the end of an unchanged prefix, with identical settings and sequential requests after the first response has begun. New input and output lengths are constant. Growing conversation history, automatic caching, parallel first requests, multiple breakpoints and mixed TTLs are excluded.

Each cache hit refreshes its lifetime

Lifetime is counted from the start of a write or read request. A successful read refreshes TTL without another write charge. An interval below 5 or 60 minutes is treated as a read; at or above the boundary it is treated as a rewrite. Actual cache entries may not disappear immediately at expiry, so hits after the boundary cannot be confirmed.

Short prefixes use standard input pricing

Below the model's minimum prefix length, all input uses the standard rate, with no cache writes or reads. Tokens differ from characters; use the model's token count. The 200,000 input tokens, 8,192 output tokens and 1,000 requests are calculator bounds, not model limits.

Four components make up the total

Cache writes + cache reads + uncached input + output. Cached input is not also charged as uncached input. Output and new input still cost money, so the total discount differs from the cache-read discount. Tax, currency conversion, Batch, priority processing, regional surcharges, tool fees, Bedrock, Vertex and Claude subscriptions are excluded.

Sources & verification scope

Official rates, minimum prefix lengths, TTL refresh, usage categories and Haiku 5.5 prompt-length tiers were checked on 2026-11-05. No paid API requests or billing verification were performed. Price changes affect results. Rates are normally rechecked monthly.

Operator: kim hyun · NanoBook · Report an error

Revision history · First published 2026-11-04 with three models and three caching options. Added Haiku 5.5 and its two prompt-length pricing tiers on 2026-11-05.

2026-11-05 · Added the fixed-workload break-even study, request-count × interval matrix, reproducible dataset and method. Official rates were rechecked; no live API charges were measured.