Anthropic 在 Messages API 公测消息线程功能
To use it, add the thread parameter and beta header to your requests. It's available on the Claude Platform, Claude Platform on AWS, Claude in Microsoft Foundry
AI 导读
Anthropic 在 Messages API 上公测消息线程功能,API 会在服务端缓存对话,开发者只需发送新消息和上一条消息 ID,无需重发完整对话。该功能已在 Claude Code 中集成,在 500K 至 1M token 的请求上,首 token 中位时间降低约 35%;长对话中请求体积中位数从约 800 KB 降至 1.8 KB。使用时需在请求中加入 thread 参数和 beta header,该功能已在 Claude Platform、AWS 上的 Claude Platform、Microsoft Foundry 中的 Claude 以及 Google Cloud 上的 Claude 提供,按标准 token 价格计费。
推荐理由
精选AI 评分 66
官方给出消息线程在 Messages API 公测的接入方式,并披露 Claude Code 中首 token 延迟与请求体积的实测变化。
主题
正文 · AI 翻译
要使用该功能,请在请求中添加 thread 参数和 beta 标头。该功能已在 Claude Platform、AWS 上的 Claude Platform、Microsoft Foundry 中的 Claude 以及 Google Cloud 上的 Claude 提供,按标准 token 价格计费。
完整博客:https://t.co/x4NKvBLcSg