Anthropic在Messages API公测消息线程功能
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价格计费。另一篇Claude Blog文章称,该功能已在多数Claude Code用户中默认开启,线程在最后一次请求后5分钟过期,期间在内存中加密保存、不写入磁盘,token用量不变。
匹配字段摘要