981 views · 7 likes · 0 reposts (at collection)
Anthropic opens public beta of Message Threads for the Claude Messages API
- Who
- Anthropic
- What
- launched public beta of Message Threads Claude Messages API
- Quote
Anthropic 今天给 Messages API(开发者调用 Claude 的主要接口)上线了“消息线程”(message threads)公测:服务器替你把对话暂存几分钟,下一轮只需要发新消息和上一条回复的 ID。
What happened
Anthropic has launched a public beta of message threads on the Messages API, which caches a conversation on the server for a few minutes so developers send only new messages plus the previous message ID. Anthropic reports median time to first output dropping about 35% for 500K to 1M token requests, and median request size falling from about 800 KB to 1.8 KB. Pricing and rate limits are unchanged, and threads expire after 5 minutes without a request.
Read next
See the full storyAnthropic opens Message Threads public beta for Claude Messages APIClaude API 公测 Message Threads:长对话不用每轮重发历史,回复更快,价格不变
Anthropic 今天给 Messages API(开发者调用 Claude 的主要接口)上线了“消息线程”(message threads)公测:服务器替你把对话暂存几分钟,下一轮只需要发新消息和上一条回复的 ID。
以前这个接口不记历史消息,每次请求都要把之前所有消息、工具返回的结果从头再发一遍。Agent 一次会话可能发几百个请求,对话涨到几十万 token 后,光是重发就会拖慢 Claude 开始回复的时间。
Claude Code 已经给大多数用户默认开了这个功能。官方数据:50 万到 100 万 token 的请求,从发出到 Claude 开始输出的等待时间(中位数)缩短约 35%;长对话里,单次请求的大小(中位数)从约 800 KB 降到 1.8 KB。
【要多花钱吗】
不用,但也省不了钱。按标准 token 价格计费,速率限制不变。请求虽然变小了,Claude 每轮仍要读一遍完整对话,消耗的 token 和以前一样。
【和提示词缓存有什么区别】
提示词缓存(prompt caching)让服务器不用重复处理已经读过的内容,命中缓存的部分按更低价格计费,省的是钱和计算。消息线程省的是上传,你不用再把整段历史传过去。线程不会自动帮你做缓存,缓存断点还得自己设,官方示例里两者是一起用的。
【开发者怎么用】
在请求里加 thread 参数和 beta 请求头(message-threads-2026-08-12)。第一轮照常发完整对话、系统提示词和工具定义,标记为新建线程;之后每轮只发新消息,带上上一条回复的 ID。
线程 5 分钟没有新请求就过期,接口返回 404,这时要用你自己保存的完整对话重新建一个线程。所以本地仍要留一份完整记录,官方 SDK 的辅助方法能自动处理这一步。
线程中途不能改系统提示词和工具,模型、思考设置也要和第一轮一致,想改就得重开线程。线程数据加密存在内存里、不写硬盘,但它不支持零数据保留(ZDR)和 HIPAA 合规,对数据留存有严格要求的企业要留意。批处理接口暂不支持。
适合长时间运行的 Agent、操作电脑的 Agent(截图不用每轮重传),以及带大量文档、图片的对话。Claude 自家平台、AWS、Microsoft Foundry 和 Google Cloud(Anthropic 托管版)上都能用。
博客:https://claude.com/resources/articles/message-threads
文档:https://platform.claude.com/docs/en/build-with-claude/message-threads
Message threads are now in public beta on the Messages API. The API caches your conversation on the server between turns, so instead of resending the full conversation, you send only new messages and the previous message ID, and Claude starts responding sooner.View the quoted post on X
The story so far
Anthropic has launched a public beta of message threads on the Claude Messages API, which caches a conversation on its servers for a few minutes so developers send only the new message plus the previous message ID. Anthropic reports median time to first output dropping about 35% for requests of 500K to 1M tokens, and median request size falling from about 800 KB to 1.8 KB. Pricing and rate limits are unchanged, so threads save bandwidth but not money. A thread expires after 5 minutes without a request and the API returns 404, at which point developers must recreate it from their own saved full conversation. System prompts and tools cannot be changed mid-thread, and the model and thinking settings must match the first turn; changing any of them requires a new thread. Thread data is encrypted and held in memory rather than written to disk, but the feature does not support zero data retention (ZDR) or HIPAA compliance, a consideration for enterprises with strict data-retention requirements.
Keep up with AI, one email a day
Model releases, price changes and compute developments, with original sources. Free, confirmed by email, and easy to unsubscribe. Read a past issue · 2026-11-03
