PulseAugur
实时 14:44:34
English(EN) How prompt caching works in Claude Code (and how to stop wasting tokens)

Claude Code 的提示缓存可节省成本,但缓存未命中时可能导致更高费用

Claude Code 利用提示缓存机制来降低持续对话的 token 成本。此功能会缓存初始提示和后续轮次,缓存内容按大幅降低的费率计费。但是,如果对话超过缓存的生存时间(TTL)或更改了提示前缀,缓存将失效,导致整个上下文按全额 token 费用计费。默认 TTL 因身份验证方法而异,订阅用户通常受益于更长的 1 小时 TTL,而基于 API 的设置默认为 5 分钟。 AI

影响 了解 Claude Code 的提示缓存可以帮助用户优化 token 使用量,并降低延长对话的成本。

排序理由 该条目详细介绍了产品(Claude Code)的特定功能及其成本影响,而不是新的发布或重大的行业事件。

在 r/ClaudeAI 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

Claude Code 的提示缓存可节省成本,但缓存未命中时可能导致更高费用

报道来源 [1]

  1. r/ClaudeAI TIER_2 English(EN) · /u/jomi-se ·

    How prompt caching works in Claude Code (and how to stop wasting tokens)

    <!-- SC_OFF --><div class="md"><p>**TL;DR:** Claude Code caches your prompts as you go. When continuing an existing conversation, the previous part of your prompt that is already cached is billed only at 10% of the full cost. By default, Claude Code in billed-per-token setups set…