创建

登录 ReadmeX

或

了解我们如何处理你的信息: 隐私政策

ReadmeX

陪你读懂 AI 动态

今天,想先了解什么?

选一份动态总结,或直接聊聊你的问题。

社区和关注动态总结只属于你自己。

资讯

OpenRouter实测降低智能体令牌成本

AI 总结

OpenRouter通过API以六种上下文配置重放了一个40步的合成编程会话,并测量令牌用量、缓存命中、成本和准确率。在系统提示开头加入时间戳会破坏提示缓存,使同一会话成本从0.084美元升至0.658美元;而仅在工具结果进入历史时截断一次,则以0.054美元成为最便宜的方案。OpenRouter建议保持提示前缀不变、全程使用相同的session_id,并避免反复总结先前的总结。

深度见解

测试表明,保持相同的缓存前缀有时比单纯减少令牌数量更重要,但结论仅基于一个合成会话、一个模型和单一提供商的缓存设置。

How to Reduce Token Usage in AI Agents (Measured)

OpenRouter ·12/1/2026

How to Reduce Token Usage in AI Agents (Measured)
How to Reduce Token Usage in AI Agents (Measured)

An AI agent resends its whole conversation to the model on every step, so a long session’s token count and its bill grow with every call. This guide shows you how to bring both down, using measurements instead of guesswork.

We replayed one 40-step coding session through the OpenRouter API under six context setups, including one failed first attempt at compaction, and measured the tokens, cache hits, cost and accuracy of each. The most expensive run sent exactly the same tokens as a much cheaper one, and the difference came down to one line in the system prompt.

#OpenRouter#OpenAI#GPT-6 Luna

原文约 10 分钟读完阅读原文
群聊

还没有评论,来说说你的看法。