LIVE · Thursday 3 December

Anthropic Prompt Caching vs Self-Hosted Prefix Caching on H100s: The API Is Cheaper at 80M Tokens a Day

At 80M input tokens a day and 90% reuse, Anthropic's cached input costs $1.61 to $50 a day and a rented H100 $48 to $192. Here is which option fits which workload, with every assumption shown.

By Thomas8 min read

For 80 million input tokens a day with a 90% repeated prefix, Anthropic prompt caching is the cheaper option on every current Claude model: cached input costs about $1.61 a day on Haiku 5.5, $25 on Sonnet 5.5 and $50 on Opus 5.5, against $48 to $192 a day for one H100 at November 2026 cloud prices per hour, and twice that with a standby replica. Self-hosting with vLLM or SGLang prefix caching competes only when output on Sonnet or Opus is heavy, or volume is several times higher. If an open model meets your quality bar, shared per-token serving is cheaper than both.

How to read the options

Three ways to serve the same workload are priced here. Anthropic's API discounts repeated prefixes directly: its pricing page bills a cache hit at 0.1x base input on most models and 0.05x on Opus 5.5 and Sonnet 5.5, and a five-minute cache write at 1.25x. Self-hosting rents GPUs by the hour and runs an engine whose prefix cache saves compute; vLLM's docs say it "only reduces the time of processing the queries (the prefilling phase)", so the hourly bill is the same at any hit rate. Shared managed serving runs open models on a provider's pooled GPUs and bills per token, often with its own cached-input price.

All prices below are list prices on November 17, 2026. The API figures assume each day's 80 million input tokens split into 8 million new tokens at base price, 71.2 million cache hits and 0.8 million five-minute cache writes; the GPU figures assume 24 hours of rental.

Option at 80M tokens/day, 90% reuse Input only, per day With 20% output Per M input tokens
Claude Haiku 5.5, cached $1.61 $9.61 $0.02
Claude Sonnet 5.5, cached $25.12 $185.12 $0.31
Claude Opus 5.5, cached $50.24 $370.24 $0.63
gpt-oss-120B on Fireworks, cached $2.28 $11.88 $0.03
2x H100 on RunPod Secure ($2.89/hr) $138.72 $138.72 $1.73

The GPU row does not move with output, as long as the cards keep up, which has not been measured. The token rows rise with output because no option discounts generated tokens.

If your traffic is steady and mostly input

This is the 80-million-token case, and the API wins clearly. A model that fits on one card, such as a 30-billion-class model, costs $47.76 a day on RunPod's Community Cloud H100 PCIe (from $1.99 an hour), $65.52 at Akash's November 3 weighted-average marketplace rate of $2.73, $69.36 on RunPod Secure, $90.96 on Lambda's single H100 PCIe at $3.79, $131.76 on a Together dedicated H100 at $5.49, and $192 on Fireworks at $8.00. Larger clouds sell H100s in eight-GPU blocks: CoreWeave lists an HGX H100 node at $49.24 an hour on demand, or $1,181.76 a day, and AWS prices its p5 Capacity Block reservations at $5.97 per GPU-hour, $1,146.17 a day for the eight-card instance. Even the cheapest redundant pair, $95.52 a day, is about four times Sonnet 5.5's cached input bill and nearly twice Opus 5.5's.

Steady traffic also flatters the API. Anthropic's prompt caching docs say "the cache is refreshed for no additional cost each time the cached content is used," so a prefix hit every few seconds stays warm indefinitely and the 1% write allowance is generous. Put whatever does not need an immediate answer through the Batch API, whose 50% discount the pricing page says stacks with cache multipliers.

One trap: Haiku 5.5's $0.10 and $0.01 rates apply only to prompts up to 100,000 tokens, and Anthropic counts cached tokens toward that length. If your shared prefix pushes prompts past it, the same workload costs about $8.06 a day.

If you generate a lot of output on Sonnet or Opus

Output is where self-hosting can catch up. At 20% output, 16 million tokens a day, Sonnet 5.5 costs $185 and Opus 5.5 $370, both above two RunPod Secure H100s. Against that pair, the API costs the same at 60 million input tokens a day on Sonnet 5.5 with 20% output and 30 million on Opus 5.5; at 5% output the lines are 170 million and 85 million.

Before acting on that, check two things. First, quality: a self-hosted open model should be compared with an API model of similar capability, and if that is Haiku 5.5, two GPUs break even only at about 1.15 billion tokens a day even at 20% output. Second, capacity: whether two H100s can carry 16 million output tokens a day for a given model with prefix caching on has not been measured. A 70B model in FP8 needs about 70 GB for weights alone, at one byte for each of Llama 3.3 70B's 70 billion parameters, nearly all of an 80 GB H100, so it needs two cards before redundancy and four with it.

If an open model is good enough

Then shared serving is the cheapest line in the table. Fireworks lists gpt-oss-120B at $0.15 per million input tokens, $0.015 cached and $0.60 output, and says cached input carries "no write fee". DeepSeek V4.1 Flash, listed on both Fireworks and Together at $0.30 input and $0.006 cached, prices this workload at about $2.83 a day on input. The provider pools the idle time across customers, which is exactly the cost a single-tenant H100 cannot avoid at 926 tokens a second. You give up the choice of model and the ability to tune the engine.

Parsec, a small language model lab, sells a shared-cluster service for models post-trained on a customer's own traffic; its comparison page says the models "run alongside other teams' on an optimized cluster" and claims 60% savings without a baseline. It publishes no price for this service, so it cannot be placed in the table.

If you have many distinct prefixes or bursty traffic

Here the two caches behave differently, and the self-hosted one is the riskier. PrefixBench-H100, submitted to arXiv on September 17, 2026, ran Qwen2.5-32B on one H100 NVL with 19.4 GB of KV cache. When the distinct prefixes filled 0.4x of that cache, vLLM's hit rate was 88.9%; at 1.7x it fell to 46.6%, and at 6.6x to 12.6%, with median time to first token rising from 0.091 to 1.42 seconds. Neither vLLM nor TensorRT-LLM reports evictions, the authors note. Bursts hurt latency too: at a 4,096-token prefix, vLLM's median time to first token went from 42 ms at one concurrent request to 759 ms at 32.

On the API, bursty traffic costs money rather than latency, and the cost is easy to bound. A cache entry lasts five minutes from the start of the last request that used it, and a hit needs "100 percent identical prompt segments". Anthropic also says a new cache entry is available only once the first response starts, so parallel requests sent before then do not get a hit.

If you are heading for billions of tokens a day

The API bill grows linearly with volume; a GPU fleet grows in steps. This table shows the daily API cost at 90% reuse with output at 5% of input.

Input tokens per day Haiku 5.5 Sonnet 5.5 Opus 5.5
10M $0.45 $8.14 $16.28
80M $3.61 $65.12 $130.24
500M $22.58 $407 $814
2B $90.30 $1,628 $3,256
10B $451.50 $8,140 $16,280

At 2 billion tokens a day Sonnet 5.5's bill pays for about 23 RunPod Secure H100s around the clock, and at 10 billion about 117. How many H100s or B200s a given model needs at those volumes with prefix caching on has not been measured: no primary source publishes prefill and decode throughput for 8B, 30B and 70B models in FP8 at 50%, 90% and 99% hit rates, and PrefixBench covers only 7B and 32B in BF16. At these volumes, also ask Anthropic about pricing; its page says volume discounts "are negotiated on a case-by-case basis."

Worked example: 80M tokens a day, steady versus bursty

Take Sonnet 5.5 against a two-card RunPod Secure deployment of an open model the reader has already validated as equivalent, with output at 5% of input.

Steady traffic. Input arrives at an even 926 tokens a second, of which 93 need full prefill. API: 8M x $2 = $16.00, 71.2M x $0.10 = $7.12, 0.8M x $2.50 = $2.00, and 4M output x $10 = $40.00, for $65.12 a day, or $0.81 per million input tokens. Self-hosted: 48 GPU-hours x $2.89 = $138.72, or $1.73 per million. Utilisation of the two cards at this load has not been measured, but the second card exists only as a standby.

Bursty traffic. Assume the same daily volume arrives in bursts with quiet gaps longer than five minutes, so that a tenth of the 72 million prefix tokens are written again instead of read. API: 7.2M x ($2.50 - $0.10) = $17.28 more, for $82.40 a day. Self-hosted: unchanged at $138.72 if the peak fits on one card, more if bursts need extra capacity or the prefixes outgrow the cache. Staff time is extra on the self-hosted side: no primary source prices it for an endpoint this size, but every $1,000 a month adds about $33 a day.

Either way, Sonnet 5.5 is cheaper. To rerun the sums with your own numbers, the formulas are:

  • API per day = V x [(1 - r) x base + (r - w) x hit + w x write] + O x output, where V is input tokens in millions, r the reuse share, w the share rewritten, O output tokens in millions.
  • Self-hosted per day = GPUs x hourly rate x 24, plus staff cost per month / 30.

Bottom line

At 80 million input tokens a day with 90% reuse, choose Anthropic prompt caching: Haiku 5.5 if it meets your quality bar, Sonnet 5.5 or Opus 5.5 otherwise, with batch for anything that can wait. Choose shared per-token serving if an open model is good enough. Price self-hosted vLLM or SGLang prefix caching only if output on Sonnet or Opus approaches a fifth of input, or volume reaches hundreds of millions of tokens a day, and only after measuring the open model's quality and checking that your distinct prefixes fit in GPU memory.

Sources

More in Chips & Compute

All Chips & Compute →