Prompt Caching 是什么:智能体每轮省下 95% 的 Token 费用
写智能体的人都该看看这篇:50,000 tokens 的上下文每轮从 $0.15 降到 $0.0075,省 95%。核心就一条——system prompt 别在中途改,改了缓存就没了,钱又得照付。适合天天跑多轮 Agent 调用的开发者。
Prompt caching 让模型在多轮对话中不必每轮重新读取相同的前缀。举例来说,智能体每轮都要重新读取 50,000 tokens 的上下文,在 Gemini 4 Neon 上每轮要花 $0.15,启用缓存后降到 $0.0075,成本相差 20 倍。
其机制是把 system prompt、工具定义、长文档等不变化的前缀部分缓存到服务端,后续请求直接复用,只按缓存价格计费。这对需要反复调用同一套长系统提示词的智能体应用效果最明显,因为智能体通常每一轮都带着几乎相同的上下文。
使用时有一个关键限制:一旦在会话中途修改 system prompt,缓存就会失效,后续请求需要重新写入完整前缀。因此开发者应尽量保持前缀稳定,把容易变化的内容放在提示词末尾,才能持续享受缓存带来的低价。
wtf is prompt caching.
Your agent re-reads the same 50,000 tokens every turn. On Gemini 4 Neon that's $0.15 a turn. Cached, it's $0.0075.
Rewrite the system prompt mid-session and the cache is gone. https://t.co/PHVsMaDpRY
This report is categorized under AITOP's "How-to" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows and US-China foundation model benchmarks and commercialization comparison. Key entities and technical topics under continuous tracking include Prompt Caching, Gemini 4 Neon, prompt engineering, agents.
Source attribution: curated from Shubham Saboo (@Saboo_Shubham_).