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 | Configuration for where sessions run: an Anthropic-managed cloud container, or a self-hosted sandbox on your own infrastructure |
| 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 目前處於測試版。所有 Managed Agents 端點都需要 managed-agents-2026-04-01 測試版標頭。SDK 會自動設置測試版標頭。行為可能在版本之間進行調整以改進輸出。
要開始使用,您需要:
某些功能(結果、多代理和記憶)處於研究預覽版。請求訪問以試用它們。
Managed Agents 端點按組織進行速率限制:
| 操作 | 限制 |
|---|---|
| 創建端點(代理、會話、環境等) | 每分鐘 60 個請求 |
| 讀取端點(檢索、列表、流等) | 每分鐘 600 個請求 |
組織級別的支出限制和基於層級的速率限制也適用。
對於集成 Claude Managed Agents 的合作夥伴,使用 Claude 品牌是可選的。在您的產品中引用 Claude 時:
允許:
不允許:
您的產品應保持自己的品牌,不應顯示為 Claude Code、Claude Cowork 或任何其他 Anthropic 產品。有關品牌合規性的問題,請聯繫 Anthropic 銷售團隊。