{"slug": "prompt-caching-and-marketplace-pricing-where-the-discount-really-lands", "title": "Prompt caching and marketplace pricing: where the discount really lands", "summary": "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.", "body_md": "*Published 2026-11-28 · LONG AI Engineering Notes*\n\nThe 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.\n\nCaching 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.\n\nA 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:\n\nOnly the prefix. Nothing after the first divergence is cached. A system prompt plus tool schema is cacheable; the user message never is.\n\nOnly 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.\n\nOnly if identical. One whitespace change, one timestamp inserted at the top, one reordered JSON field in the tool schema, and the cache misses entirely.\n\nSo 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.\n\nTake a concrete shape, because abstractions hide the point. A 20-step agent task on a text model, each step sending:\n\n| Component | Tokens per step | Cacheable? | \n|---|---|---|\n| System prompt + tool schema | 2,000 | Yes (prefix) | \n| Retrieved context (changes per step) | 1,500 | No | \n| Conversation history (grows) | 1,000 → 4,000 | Partially, if append-only | \n| Output | 400 | Never | \n\nWith 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.\n\nNow 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.\n\nOn 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](https://ai.dijinlong.com/pricing)). The mean was 1.43, dragged down by that cluster, which is exactly why the median is the honest number for budgeting.\n\nOnce 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.\n\nThere 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.\n\nDoes 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.\n\nIs 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](https://ai.dijinlong.com/docs) list which fields pass through unchanged.\n\nDoes 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.\n\nAll three are answerable per model, and the answers differ by model even within one vendor. The [per-model reference pages](https://ai.dijinlong.com/model-docs) are the place to check them, not the marketing page.\n\nMeasure 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.\n\n```\n# sanity check: is caching actually applied to this model?\ncurl https://api.example.com/v1/chat/completions \\\n  -H \"Authorization: Bearer $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"MODEL_ID\",\"messages\":[\n       {\"role\":\"system\",\"content\":\"...long fixed prefix...\"},\n       {\"role\":\"user\",\"content\":\"same question\"}]}'\n# run twice; compare usage.prompt_tokens and any cached_tokens field\n```\n\nIf 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.\n\nShort 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.\n\n— 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.", "url": "https://wpnews.pro/news/prompt-caching-and-marketplace-pricing-where-the-discount-really-lands", "canonical_source": "https://dev.to/longai/prompt-caching-and-marketplace-pricing-where-the-discount-really-lands-7ld", "published_at": "2026-11-28 11:11:19+00:00", "updated_at": "2026-11-28 11:13:40.987397+00:00", "lang": "en", "topics": ["large-language-models", "ai-infrastructure", "ai-agents", "mlops"], "entities": [], "also_reported_by": [], "takeaway": "A 90% cache hit on a 2,000-token prefix saved only about 6% of a 20-step agent's total bill, and a 0.5 marketplace unit-price discount halved that absolute saving again, so budget caching and marketplace discounts on separate multipliers.", "recommendation": {"advice": "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.", "playbook": "llm-cost", "playbook_url": "https://wpnews.pro/playbooks/llm-cost"}, "alternates": {"html": "https://wpnews.pro/news/prompt-caching-and-marketplace-pricing-where-the-discount-really-lands", "markdown": "https://wpnews.pro/news/prompt-caching-and-marketplace-pricing-where-the-discount-really-lands.md", "text": "https://wpnews.pro/news/prompt-caching-and-marketplace-pricing-where-the-discount-really-lands.txt", "jsonld": "https://wpnews.pro/news/prompt-caching-and-marketplace-pricing-where-the-discount-really-lands.jsonld"}}