OpenAI刚刚让长时间运行的AI代理便宜了许多。从昨天起,Responses API可以将你的提示缓存保留12小时。以前是30分……

·

产品与工具 · 2026/10/22

OpenAI 将 Responses API 的提示缓存时间从 30 分钟延长至 12 小时,使长时间运行的 AI 代理成本大幅降低。缓存输入费用仅为正常输入的 1/10(GPT-6.1 Sol 上为 1/20),写入 12 小时缓存的成本是正常输入费率的 2.5 倍,从第三次重用开始即比无缓存更划算。对于每小时运行一次的代理,成本可降低约 75%。Codex 和 Work 的缓存永久保留。但缓存仅匹配提示的开头,因此建议按系统指令、工具文档、示例、对话历史、新消息的顺序构建提示,并避免在开头放置时间戳等可变内容。

这篇文章揭示了OpenAI提示缓存策略的重大更新,能帮助开发者显著降低长时运行AI代理的API成本,并提供了实用的提示构建最佳实践,对于使用OpenAI API的团队具有直接的经济价值。

OpenAI just made long-running AI agents a lot cheaper.

As of yesterday, the Responses API can keep your prompt cache for 12 hours. It used to be 30 minutes.

Why it matters: an agent that runs all day sends the same instructions, tools and docs over and over. Before, any pause over 30 minutes meant paying full price for all of it.

The numbers (GPT-5.6 and newer):

→ Cached input costs 10x less, 20x less on GPT-6.1 Sol

→ Writing a 12-hour cache costs 2.5x the normal input rate

→ It beats no caching from the 3rd reuse

For an agent that runs once an hour on GPT-6.1 Sol, that's roughly 75% cheaper.

Codex lead Tibo also says Codex and Work now keep your cache forever, so coming back to an old thread doesn't start from zero.

One catch most people miss: the cache only matches the start of your prompt. Change one word at the top and the discount is gone.

So build every agent prompt in this order:

1. System instructions (never change)

2. Tools and docs (rarely change)

3. Examples

4. Conversation history

5. The new message (always last)

Keep timestamps, user names and random IDs out of the top.

How much of your API bill is the same prompt sent twice?

OpenAI's prompt caching guide: http://developers.openai.com/api/docs/guides/prompt-caching

More prompts for building agents: http://godofprompt.ai

阅读原文

参与讨论