←新闻详情

Claude Blog更新于 11月3日 03:35

Anthropic 在 Messages API 推出 message threads 公测

Make long-running agents faster with message threads

AI 导读

Anthropic 在 Claude Platform 上线 Messages API 的 message threads 公测,智能体每轮只需发送新增内容,不必重发完整对话历史。对 500k 至 1M token 的请求,中位首 token 延迟(TTFT)下降约 35%,该功能已在多数 Claude Code 用户中默认开启。使用时在请求中加入 thread 参数,首轮发送完整对话并开启线程,后续只带新消息和上一响应 ID;线程在最后一次请求后 5 分钟过期,期间在内存中加密保存、不写入磁盘,token 用量不变。

推荐理由

AI 评分 52

原文给出了消息线程的机制、默认开启范围和 TTFT 降幅,读者可据此判断长会话智能体的延迟优化空间。

主题

标签

正文

New in the Messages API, send your conversation once, and the API receives only what’s new with every turn.

Message threads is now available in public beta on the Claude Platform. With message threads, agents no longer need to resend the full conversation history on every turn, reducing latency for long-running sessions.

How message threads works

A coding agent might make hundreds of requests in one session, and each request resends every earlier message and tool result. Once a conversation reaches hundreds of thousands of tokens, resending all of it adds time before Claude starts responding. With message threads, agents send only what’s new since the last turn, which reduces time to first token (TTFT).

With message threads on by default for most Claude Code users, requests with 500k to 1M tokens see median TTFT drop by about 35%.

To use message threads, add the thread parameter to Messages API requests. The first request includes the full conversation and starts a thread. Each request after that includes only the new messages and the ID of the previous response. Between turns, we hold each thread in memory, where it’s encrypted and not written to disk. A thread expires 5 minutes after its last request and your client then resends the full conversation to start a new one. While each request is smaller with message threads, Claude still reads the full conversation on every turn, so token usage stays the same.

Message threads is best for active sessions where latency matters, including:

Long-running coding agents , where each tool result or file edit adds to the conversation.

Computer use agents , where screenshots stay with the thread instead of being re-uploaded on every turn.

Document and image-heavy workflows , where requests are made smaller.

The more context an agent carries, the more message threads can reduce time to first token.

Getting started

Related articles

Explore more product news and best practices for teams building with Claude.

Smart reports, surveys, and pooled group budgets for Claude Enterprise

In many organizations, members have identified the unique work that Claude can unlock. The next step is expanding that work to every team.

IDC brings Quanta into Claude and adopts Claude across the company

IDC integrated Claude as part of its Quanta platform, and it has rolled Claude out across its own business

Introducing artifacts for legal work

Claude for Legal now includes ready-to-use artifacts for legal work that teams can adapt with their own data and connectors, and share across the business.

Claude for Financial Advisors

Financial advisors can now connect Claude to the custodians, portfolio platforms, CRMs, and planning tools they depend on, along with new skills tailored to the daily work of a financial advisor.

Transform how your organization operates with Claude

Product updates, how-tos, community spotlights, and more. Delivered monthly to your inbox.

Responsible disclosure policy

Data Processing Agreement: US K-12

Responsible disclosure policy

Data Processing Agreement: US K-12

来源

Claude Blog