Was this page helpful?
Anthropic offers two ways to build with Claude, each suited to different use cases:
| Messages API | Claude Managed Agents | |
|---|---|---|
| What it is | Direct model prompting access | Pre-built, configurable agent harness that runs in managed infrastructure |
| Best for | Custom agent loops and fine-grained control | Long-running tasks and asynchronous work |
| Learn more | Messages API docs | Claude Managed Agents docs |
Claude Managed Agents 提供了运行 Claude 作为自主代理的框架和基础设施。您无需构建自己的代理循环、工具执行和运行时,而是获得一个完全托管的环境,其中 Claude 可以读取文件、运行命令、浏览网络和安全地执行代码。该框架支持内置的提示缓存、压缩和其他性能优化,以实现高质量、高效的代理输出。
Claude Managed Agents 围绕四个概念构建:
| Concept | Description |
|---|---|
| Agent | The model, system prompt, tools, MCP servers, and skills |
| Environment | A configured container template (packages, network access) |
| Session | A running agent instance within an environment, performing a specific task and generating outputs |
| Events | Messages exchanged between your application and the agent (user turns, tool results, status updates) |
创建代理
定义模型、系统提示、工具、MCP 服务器和技能。创建一次代理,然后在各个会话中通过 ID 引用它。
创建环境
配置一个云容器,其中预装了软件包(Python、Node.js、Go 等)、网络访问规则和挂载的文件。
启动会话
启动一个引用您的代理和环境配置的会话。
发送事件和流式传输响应
将用户消息作为事件发送。Claude 自主执行工具并通过服务器发送事件(SSE)流式传输结果。事件历史记录在服务器端持久化,可以完整获取。
引导或中断
发送额外的用户事件来在执行过程中引导代理,或中断它以改变方向。
Claude Managed Agents 最适合需要以下功能的工作负载:
Claude Managed Agents 为 Claude 提供了一套全面的内置工具:
请参阅工具了解完整列表和配置选项。
Claude Managed Agents 目前处于 beta 阶段。所有 Managed Agents 端点都需要 managed-agents-2026-04-01 beta 标头。SDK 会自动设置 beta 标头。行为可能会在版本之间进行优化以改进输出。
要开始使用,您需要:
某些功能(结果、多代理和内存)处于研究预览阶段。请求访问以试用它们。
Managed Agents 端点按组织进行速率限制:
| 操作 | 限制 |
|---|---|
| 创建端点(代理、会话、环境等) | 每分钟 60 个请求 |
| 读取端点(检索、列表、流等) | 每分钟 600 个请求 |
组织级别的支出限制和基于层级的速率限制也适用。
对于集成 Claude Managed Agents 的合作伙伴,使用 Claude 品牌是可选的。在您的产品中引用 Claude 时:
允许的:
不允许的:
您的产品应保持自己的品牌,不应显示为 Claude Code、Claude Cowork 或任何其他 Anthropic 产品。如有关于品牌合规性的问题,请联系 Anthropic 销售团队。