Skip to content

缓存节省计算器

看看提示词缓存能省多少钱——对比N次请求下有缓存与无缓存的成本,并给出写入溢价的盈亏平衡点。

AI & Agents
cosmodev ~/tools/cache-savings-calculator-
节省 $0.33 (43.33%)
$0.75 未缓存 → $0.43 已缓存 · 5 次请求
盈亏平衡: 13 缓存命中——读取须偿还一次写入溢价
uncached = hits × (prompt×in$/M + output×out$/M) / 1M
          = 5 × (10,000×$10 + 1,000×$50) / 1M = $0.75
cached = (prompt×write$/M + hits × (prompt×read$/M + output×out$/M)) / 1M
       = (10,000×$12.5 + 5 × (10,000×$1 + 1,000×$50)) / 1M = $0.43
break-even hits = ceil(write$/M / read$/M) = ceil($12.5 / $1) = 13

数据截至 2026-09-27T12:03:11.094Z