代理
创建代理
$client->beta->agents->create(Model model, string name, ?string description, ?list<BetaManagedAgentsURLMCPServerParams> mcpServers, ?array<string,string> metadata, ?BetaManagedAgentsMultiagentParams multiagent, ?list<BetaManagedAgentsSkillParams> skills, ?string system, ?list<Tool> tools, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsAgent列出代理
$client->beta->agents->list(?\Datetime createdAtGte, ?\Datetime createdAtLte, ?bool includeArchived, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<BetaManagedAgentsAgent>获取代理
$client->beta->agents->retrieve(string agentID, ?int version, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsAgent更新代理
$client->beta->agents->update(string agentID, ?string description, ?list<BetaManagedAgentsURLMCPServerParams> mcpServers, ?array<string,string> metadata, ?Model model, ?BetaManagedAgentsMultiagentParams multiagent, ?string name, ?list<BetaManagedAgentsSkillParams> skills, ?string system, ?list<Tool> tools, ?int version, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsAgent归档代理
$client->beta->agents->archive(string agentID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsAgentModels
class BetaManagedAgentsAdvisor { $type; $model; }
The advisor model id.
class BetaManagedAgentsAgent { $type; $id; $archivedAt; /* 12 more */ }
class BetaManagedAgentsAgentReference { $type; $id; $version; }
class BetaManagedAgentsAgentToolsetDefaultConfig { $enabled; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsAgentToolsetDefaultConfigParams { $enabled; $permissionPolicy; }
Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
Permission policy for tool execution.
class BetaManagedAgentsAgentToolset20260401 { $type; $configs; $defaultConfig; }
Resolved default configuration for agent tools.
class BetaManagedAgentsAgentToolset20260401BashInput { $command; $restart; $timeoutMs; }
Shell command to execute. Omit only when restart is true.
When true, restart the persistent bash session instead of
running a command. Subsequent calls without restart will
run against the fresh session.
Per-call timeout in milliseconds. Defaults to the runner-wide tool timeout when omitted or zero.
class BetaManagedAgentsAgentToolset20260401EditInput { $filePath; $newString; $oldString; $replaceAll; }
Path of the file to edit.
Replacement text.
Substring to find and replace.
When true, replace every occurrence of old_string
instead of requiring a unique match.
class BetaManagedAgentsAgentToolset20260401GlobInput { $pattern; $path; }
Doublestar glob pattern (e.g. **/*.go). Absolute patterns
are only permitted when the runner is configured to allow
them.
Optional directory root to search under. Defaults to the runner's working directory.
class BetaManagedAgentsAgentToolset20260401GrepInput { $pattern; $path; }
Regular expression to search for.
Optional directory root to search under. Defaults to the runner's working directory.
class BetaManagedAgentsAgentToolset20260401Params { $type; $configs; $defaultConfig; }
Per-tool configuration overrides.
Default configuration for all tools in a toolset.
class BetaManagedAgentsAgentToolset20260401ReadInput { $filePath; $viewRange; }
Path of the file to read.
Optional [start_line, end_line] 1-indexed inclusive
range. When omitted the entire file is returned.
end_line of 0 or negative means "to end of file".
class BetaManagedAgentsAgentToolset20260401WriteInput { $content; $filePath; }
Full file contents to write.
Path of the file to write.
class BetaManagedAgentsAlwaysAllowPolicy { $type; }
class BetaManagedAgentsAlwaysAskPolicy { $type; }
class BetaManagedAgentsAnthropicSkill { $type; $skillID; $version; }
class BetaManagedAgentsAnthropicSkillParams { $type; $skillID; $version; }
Identifier of the Anthropic skill (e.g., "xlsx").
Version to pin. Defaults to latest if omitted.
class BetaManagedAgentsAutoPolicy { $type = 'auto'; }
class BetaManagedAgentsBashToolConfig { $type = 'bash'; $enabled; $name; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsBashToolConfigParams { $type; $name; $enabled; $permissionPolicy; }
Must be "bash".
Whether this tool is enabled and available to Claude. Overrides the default_config setting.
Permission policy for tool execution.
class BetaManagedAgentsCustomSkill { $type; $skillID; $version; }
class BetaManagedAgentsCustomSkillParams { $type; $skillID; $version; }
Tagged ID of the custom skill (e.g., "skill_01XJ5...").
Version to pin. Defaults to latest if omitted.
class BetaManagedAgentsCustomTool { $type; $description; $inputSchema; $name; }
JSON Schema for custom tool input parameters.
class BetaManagedAgentsCustomToolInputSchema { $type = 'object'; $properties; $required; }
class BetaManagedAgentsCustomToolParams { $type; $description; $inputSchema; $name; }
Description of what the tool does, shown to the agent to help it decide when to use the tool.
JSON Schema for custom tool input parameters.
Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.
class BetaManagedAgentsEditToolConfig { $type = 'edit'; $enabled; $name; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsEditToolConfigParams { $type; $name; $enabled; $permissionPolicy; }
Must be "edit".
Whether this tool is enabled and available to Claude. Overrides the default_config setting.
Permission policy for tool execution.
class BetaManagedAgentsEffortHigh { $type; }
class BetaManagedAgentsEffortLow { $type; }
class BetaManagedAgentsEffortMax { $type; }
class BetaManagedAgentsEffortMedium { $type; }
class BetaManagedAgentsEffortXhigh { $type; }
class BetaManagedAgentsGlobToolConfig { $type = 'glob'; $enabled; $name; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsGlobToolConfigParams { $type; $name; $enabled; $permissionPolicy; }
Must be "glob".
Whether this tool is enabled and available to Claude. Overrides the default_config setting.
Permission policy for tool execution.
class BetaManagedAgentsGrepToolConfig { $type = 'grep'; $enabled; $name; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsGrepToolConfigParams { $type; $name; $enabled; $permissionPolicy; }
Must be "grep".
Whether this tool is enabled and available to Claude. Overrides the default_config setting.
Permission policy for tool execution.
class BetaManagedAgentsMCPServerURLDefinition { $type; $name; $url; }
class BetaManagedAgentsMCPToolConfig { $enabled; $name; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsMCPToolConfigParams { $name; $enabled; $permissionPolicy; }
Name of the MCP tool to configure. 1-128 characters.
Whether this tool is enabled. Overrides the default_config setting.
Permission policy for tool execution.
class BetaManagedAgentsMCPToolset { $type; $configs; $defaultConfig; $mcpServerName; }
Resolved default configuration for all tools from an MCP server.
class BetaManagedAgentsMCPToolsetDefaultConfig { $enabled; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsMCPToolsetDefaultConfigParams { $enabled; $permissionPolicy; }
Whether tools are enabled by default. Defaults to true if not specified.
Permission policy for tool execution.
class BetaManagedAgentsMCPToolsetParams { $type; $mcpServerName; $configs; $defaultConfig; }
Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.
Per-tool configuration overrides.
Default configuration for all tools from an MCP server.
enum BetaManagedAgentsModel
Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows
High-performance model for coding and agents
Next generation of intelligence for the hardest knowledge work and coding problems
Powerful intelligence for long-running agents and coding
Powerful intelligence for long-running agents and coding
Powerful intelligence for long-running agents and coding
Powerful intelligence for long-running agents and coding
Best combination of speed and intelligence
Fastest model with near-frontier intelligence
Fastest model with near-frontier intelligence
Powerful intelligence for long-running agents and coding
Powerful intelligence for long-running agents and coding
High-performance model for agents and coding
High-performance model for agents and coding
class BetaManagedAgentsModelConfig { $id; $effort; $inferenceGeo; $speed; }
BetaManagedAgentsModel idThe model that will power your agent.
The model that will power your agent.
See models for additional details and options.
How hard Claude works on each turn. Sets output_config.effort on every Messages call the session makes.
Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.
Inference speed mode. fast provides significantly faster output token generation at premium pricing. Not all models support fast; invalid combinations are rejected at create time.
class BetaManagedAgentsModelConfigParams { $id; $effort; $inferenceGeo; $speed; }
BetaManagedAgentsModel idThe model that will power your agent.
The model that will power your agent.
See models for additional details and options.
How hard Claude works on each inference call. Accepts a bare level string ("high") or {"type": "high"}. On create, omitting it resolves the per-model default; on update, omitting it leaves the stored value unchanged.
Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. On update, model is whole-object replacement — omitting inference_geo clears it.
Inference speed mode. fast provides significantly faster output token generation at premium pricing. Not all models support fast; invalid combinations are rejected at create time.
class BetaManagedAgentsMultiagentCoordinator { $type; $agents; }
Agents the coordinator may spawn as session threads, each resolved to a specific version.
class BetaManagedAgentsMultiagentCoordinatorParams { $type; $agents; }
Agents the coordinator may spawn as session threads. 1–20 entries. Each entry is an agent ID string, a versioned {"type":"agent","id","version"} reference, or {"type":"self"} to allow recursive self-invocation. Entries must reference distinct agents (after resolving self and string forms); at most one self. Referenced agents must exist, must not be archived, and must not themselves have multiagent set (depth limit 1).
class BetaManagedAgentsMultiagentSelfParams { $type; }
class BetaManagedAgentsReadToolConfig { $type = 'read'; $enabled; $name; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsReadToolConfigParams { $type; $name; $enabled; $permissionPolicy; }
Must be "read".
Whether this tool is enabled and available to Claude. Overrides the default_config setting.
Permission policy for tool execution.
class BetaManagedAgentsSessionThreadAgent { $type; $id; $description; /* 7 more */ }
Model identifier and configuration.
class BetaManagedAgentsAnthropicSkillParams { $type; $skillID; $version; }
Identifier of the Anthropic skill (e.g., "xlsx").
Version to pin. Defaults to latest if omitted.
class BetaManagedAgentsCustomSkillParams { $type; $skillID; $version; }
Tagged ID of the custom skill (e.g., "skill_01XJ5...").
Version to pin. Defaults to latest if omitted.
class BetaManagedAgentsURLMCPServerParams { $type; $name; $url; }
Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.
Endpoint URL for the MCP server.
class BetaManagedAgentsUserLocation { $type = 'approximate'; $city; $country; /* 2 more */ }
Location precision. Only "approximate" is supported.
City name.
Two-letter ISO 3166-1 country code, uppercase.
Region or state name.
IANA timezone identifier, e.g. "America/Los_Angeles".
class BetaManagedAgentsWebFetchToolConfig { $type = 'web_fetch'; $enabled; $name; /* 4 more */ }
Permission policy for tool execution.
class BetaManagedAgentsWebFetchToolConfigParams { $type; $name; $allowedDomains; /* 4 more */ }
Must be "web_fetch".
Only fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains.
Never fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains.
Whether this tool is enabled and available to Claude. Overrides the default_config setting.
Maximum number of tokens of fetched text content to include in context per call. Does not apply to binary content such as PDFs.
Permission policy for tool execution.
class BetaManagedAgentsWebSearchToolConfig { $type = 'web_search'; $enabled; $name; /* 4 more */ }
Permission policy for tool execution.
Approximate user location for search result localization.
class BetaManagedAgentsWebSearchToolConfigParams { $type; $name; $allowedDomains; /* 4 more */ }
Must be "web_search".
Only return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains.
Never return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains.
Whether this tool is enabled and available to Claude. Overrides the default_config setting.
Permission policy for tool execution.
Approximate user location for search result localization.
class BetaManagedAgentsWriteToolConfig { $type = 'write'; $enabled; $name; $permissionPolicy; }
Permission policy for tool execution.
class BetaManagedAgentsWriteToolConfigParams { $type; $name; $enabled; $permissionPolicy; }
Must be "write".
Whether this tool is enabled and available to Claude. Overrides the default_config setting.
Permission policy for tool execution.