Cached tokens explained: how prefix caching cuts agent costs to 2% and what breaks the hit rate

Arindam_1729 · x · 2026-10-28

Arindam's article explains prefix caching for agent loops: every turn resends the system prompt, tool definitions and history. On Nebius, DeepSeek V4.1 Flash 1017 uncached input costs $0.30/1M tokens vs $0.006/1M cached — 2% of list price. With illustrated diagrams, it covers five ways to keep the prompt prefix identical (order, tools, history append-only, timing, one model per conversation), why caching is best-effort with no SLA (cachedtokens 0 can mean eviction, different replica, or model update), serverless caches being shared per model rather than org-isolated, and how to budget at list price while treating hits as upside.

Original post →

More from coding & agent

coding & agent channel →