cd /news/large-language-models/prompt-caching-and-marketplace-prici… · home › topics › large-language-models › article
[ARTICLE · art-177702] src=dev.to ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Prompt caching and marketplace pricing: where the discount really lands

An AI engineer's analysis shows that prompt caching and marketplace discounts multiply different quantities, so they cannot be stacked as a combined percentage saving. In a worked 20-step agent example, a 90% cache hit on a 2,000-token system prompt saved only about 6% of the total bill, and halving the unit price via a marketplace cut that absolute saving in half again. The engineer also warns that cache hit rates are typically worse through a gateway because load balancing across sellers can reset the cached prefix mid-conversation.

recommendation

Measure your cacheable prefix share and output share before budgeting cache savings, and measure real cache hit rates through any multi-seller gateway rather than assuming single-upstream numbers.

more in playbook: Controlling LLM cost
by read5 min views4 publishedNov 28, 2026

Published 2026-11-28 · LONG AI Engineering Notes

The most common budgeting mistake I see with prompt caching is treating it as a second discount stacked on top of a marketplace discount. People reason: "I get 50% off official price here, and caching saves me 90% of input tokens, so my input cost is 5% of official." That arithmetic never holds, and the reason is not greed — it is that the two discounts multiply different things.

Caching discounts the cacheable portion of input. A marketplace discount discounts the unit price of the whole request. Apply them in the wrong order, or apply them to the wrong token count, and the number you put in your budget is fiction.

A prompt cache is a prefix cache. An upstream keeps the key/value state for an exact token prefix, and if the next request starts with that same prefix, it skips recomputing it. Three constraints follow immediately:

Only the prefix. Nothing after the first divergence is cached. A system prompt plus tool schema is cacheable; the user message never is.

Only input. Output tokens are generated fresh every time. Roughly 30–50% of a chat-shaped request is output in practice, and caching touches none of it.

Only if identical. One whitespace change, one timestamp inserted at the top, one reordered JSON field in the tool schema, and the cache misses entirely.

So before any arithmetic, write down two numbers for your workload: the cacheable prefix length as a share of total input, and the output share of total tokens. Without both, "caching saves 90%" is a number someone quoted from a blog post.

Take a concrete shape, because abstractions hide the point. A 20-step agent task on a text model, each step sending:

Component Tokens per step Cacheable?
System prompt + tool schema 2,000 Yes (prefix)
Retrieved context (changes per step) 1,500 No
Conversation history (grows) 1,000 → 4,000 Partially, if append-only
Output 400 Never

With a conservative single-price model at ¥0.402 per million input tokens and ¥1.610 per million output (the median and a typical 4× output multiplier from the current snapshot), the uncached bill for 20 steps is roughly ¥0.0225. Applying a 90% input cache hit on the 2,000-token prefix saves about ¥0.0014 — 6% of the total, not 90% of anything.

Now put the same task on a marketplace model selling at 0.5 of official price. The unit price drops by half, so the absolute cache saving drops by half too: about ¥0.0007. The discount and the cache both landed, but on different multipliers, and the combined effect on the invoice is a rounding error compared to what the "50% off plus 90% cache" mental model predicted.

On a marketplace where sellers compete on price, the deep discounts are already at the floor. In the November 2026 snapshot of 122 listed models from 63 vendors, the median discount was 0.5 — official price times 5% — and 70 of 122 models sat in the 0.1–0.5 range (the full per-model figures are on the live price table). The mean was 1.43, dragged down by that cluster, which is exactly why the median is the honest number for budgeting.

Once you are paying 5% of list, the remaining recoverable cost is small in absolute terms. Caching still helps, but it helps on a base that has already been cut by 95%. That is the structural reason cache savings look underwhelming on a heavily discounted gateway and look dramatic on a list-price direct account: same cache behaviour, very different denominator.

There is a second, less obvious effect: cache hit rates are usually worse through a gateway, because the same logical prefix may land on a different upstream seller between steps. Failover that reroutes a request mid-conversation resets the cache. If your agent loop depends on a warm prefix and your gateway is balancing across several sellers, measure the real hit rate through the gateway rather than assuming the single-upstream number.

Does the upstream bill cached tokens at a lower rate, or not bill them at all? Both exist. A provider that "supports caching" but bills full price for the cached portion gives you latency relief, not cost relief.

Is cache control exposed through the gateway? If the gateway strips cache_control markers or rewrites the system prompt per request, caching silently stops working and nothing in the response tells you. The API docs list which fields pass through unchanged.

Does a model switch reset the cache? Changing model mid-task invalidates the prefix on most upstreams. An A/B test that flips models every step pays full input price every step.

All three are answerable per model, and the answers differ by model even within one vendor. The per-model reference pages are the place to check them, not the marketing page.

Measure the effective cost of one task, not the unit price. Run the same 20-step loop twice — once cold, once warm — and read the usage records for input tokens and any cache-discount field. Divide by steps. That number, not a stacked-percentage, belongs in the budget.

curl https://api.example.com/v1/chat/completions \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"MODEL_ID","messages":[
       {"role":"system","content":"...long fixed prefix..."},
       {"role":"user","content":"same question"}]}'

If the second call reports the same prompt_tokens and no cached-token field, caching is not landing, and no amount of discount math will fix it.

Short version: the marketplace discount lands on every token, including output, including uncacheable input. The cache discount lands only on a slice of input, and that slice is already cheap. So the discount you should budget around is the marketplace one; the cache is a latency feature that occasionally saves a few percent of cost. Treat it in that order and your numbers stop lying to you.

— Written from the November 2026 price snapshot (122 models, 63 vendors, data as of 2026-11-25 17:46). Live prices move with seller quotes; check the price table before you commit a number to a budget.

── more in #large-language-models 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/prompt-caching-and-m…] indexed:0 read:5min 2026-11-28 · —