OpenRouter推出免费响应缓存功能
OpenRouter表示,加入X-OpenRouter-Cache: true请求头即可保存完整响应,完全相同的请求再次提交时约一秒返回,且不收取费用。厂商称,该功能会完全跳过模型,与仍会运行模型的提示词缓存不同。缓存默认保留5分钟,可通过X-OpenRouter-Cache-TTL延长至24小时。
开发者可在迭代过程中免费获取重复的模型输出,但目前该信息仅来自单一厂商技巧。
RT Kenny Rogers ⚡ @OpenRouter tip #6 Add the header X-OpenRouter-Cache: true and OpenRouter saves your entire response. Send the exact same request again and you get it back in about a second, for $0. This is different from prompt caching. Prompt caching only discounts the repeated part of your input, and the model still runs. This skips the model entirely. So if you're iterating during development you can turn this on to call the model without needing to pay for a new generation every time. The cache lasts 5 minutes by default, up to 24 hours with X-OpenRouter-Cache-TTL.