Claude Platform Docs

Agen

Buat Agen
client.Beta.Agents.New(ctx, params) (*BetaManagedAgentsAgent, error)
POST/v1/agents
Daftar Agen
client.Beta.Agents.List(ctx, params) (*PageCursor[BetaManagedAgentsAgent], error)
GET/v1/agents
Dapatkan Agen
client.Beta.Agents.Get(ctx, agentID, params) (*BetaManagedAgentsAgent, error)
GET/v1/agents/{agent_id}
Perbarui Agen
client.Beta.Agents.Update(ctx, agentID, params) (*BetaManagedAgentsAgent, error)
POST/v1/agents/{agent_id}
Arsipkan Agen
client.Beta.Agents.Archive(ctx, agentID, body) (*BetaManagedAgentsAgent, error)
POST/v1/agents/{agent_id}/archive
Models
type BetaManagedAgentsAdvisor struct { Type: "advisor"; Model }

Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

Type BetaManagedAgentsAdvisorType
Model string

The advisor model id.

type BetaManagedAgentsAgent struct { Type: "agent"; ID; ArchivedAt; /* 13 more */ }

A Managed Agents agent.

type BetaManagedAgentsAgentReference struct { Type: "agent"; ID; Version }

A resolved agent reference with a concrete version.

Type BetaManagedAgentsAgentReferenceType
ID string
Version int64
formatint32
type BetaManagedAgentsAgentToolConfigUnion interface{…}

Configuration for a specific agent tool.

One of the following:
type BetaManagedAgentsAgentToolConfigParamsUnion interface{…}

Configuration override for a specific tool within a toolset.

One of the following:
type BetaManagedAgentsAgentToolsetDefaultConfig struct { Enabled; PermissionPolicy }

Resolved default configuration for agent tools.

Enabled bool
PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsAgentToolsetDefaultConfigParams struct { Enabled; PermissionPolicy }

Default configuration for all tools in a toolset.

Enabled bool Optional

Whether tools are enabled and available to Claude by default. Defaults to true if not specified.

PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion Optional

Default permission policy for tools. Controls whether tool calls are auto-approved or require confirmation.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsAgentToolset20260401 struct { Type: "agent_toolset_20260401"; Configs; DefaultConfig }
type BetaManagedAgentsAgentToolset20260401BashInput struct { Command; Restart; TimeoutMs }

Input payload for the bash tool of the agent_toolset_20260401 toolset. All fields are optional; a normal invocation supplies command, while restart=true (with no command) reboots the runner-side bash session.

Command string Optional

Shell command to execute. Omit only when restart is true.

Restart bool Optional

When true, restart the persistent bash session instead of running a command. Subsequent calls without restart will run against the fresh session.

TimeoutMs int64 Optional

Per-call timeout in milliseconds. Defaults to the runner-wide tool timeout when omitted or zero.

minimum0
type BetaManagedAgentsAgentToolset20260401EditInput struct { FilePath; NewString; OldString; ReplaceAll }

Input payload for the edit tool. Performs a string replacement in the named file; by default old_string must occur exactly once.

FilePath string

Path of the file to edit.

NewString string

Replacement text.

OldString string

Substring to find and replace.

ReplaceAll bool Optional

When true, replace every occurrence of old_string instead of requiring a unique match.

type BetaManagedAgentsAgentToolset20260401GlobInput struct { Pattern; Path }

Input payload for the glob tool. Returns paths matching a doublestar glob pattern, newest first.

Pattern string

Doublestar glob pattern (e.g. **/*.go). Absolute patterns are only permitted when the runner is configured to allow them.

Path string Optional

Optional directory root to search under. Defaults to the runner's working directory.

type BetaManagedAgentsAgentToolset20260401GrepInput struct { Pattern; Path }

Input payload for the grep tool. Searches file contents for a regular expression, returning matching lines.

Pattern string

Regular expression to search for.

Path string Optional

Optional directory root to search under. Defaults to the runner's working directory.

type BetaManagedAgentsAgentToolset20260401Params struct { Type: "agent_toolset_20260401"; Configs; DefaultConfig }

Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.

type BetaManagedAgentsAgentToolset20260401ReadInput struct { FilePath; ViewRange }

Input payload for the read tool. Reads file contents relative to the runner's working directory (or absolute when the runner permits).

FilePath string

Path of the file to read.

ViewRange []int64 Optional

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".

minItems2
maxItems2
type BetaManagedAgentsAgentToolset20260401WriteInput struct { Content; FilePath }

Input payload for the write tool. Writes (overwriting) the entire file contents.

Content string

Full file contents to write.

FilePath string

Path of the file to write.

type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAnthropicSkill struct { Type: "anthropic"; SkillID; Version }

A resolved Anthropic-managed skill.

Type BetaManagedAgentsAnthropicSkillType
SkillID string
Version string
type BetaManagedAgentsAnthropicSkillParams struct { Type: "anthropic"; SkillID; Version }

An Anthropic-managed skill.

Type BetaManagedAgentsAnthropicSkillParamsType
SkillID string

Identifier of the Anthropic skill (e.g., "xlsx").

minLength1
maxLength64
Version string Optional

Version to pin. Defaults to latest if omitted.

minLength1
maxLength64
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsAWSRoleExecutionIdentity struct { Type: "aws_role"; RoleARN }

An AWS IAM role principal as returned in API responses.

Type AWSRole
RoleARN string

The IAM role's ARN.

type BetaManagedAgentsAWSRoleExecutionIdentityParams struct { Type: "aws_role"; RoleARN }

An AWS IAM role principal.

Type AWSRole
RoleARN string

The IAM role's ARN, e.g. "arn:aws:iam::123456789012:role/my-agent-runner". Maximum 2048 characters.

maxLength2048
type BetaManagedAgentsBashToolConfig struct { Type: "bash"; Enabled; Name; PermissionPolicy }

Configuration for the bash tool.

Type Bash
Enabled bool
Name Bash
PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsBashToolConfigParams struct { Type: "bash"; Name; Enabled; PermissionPolicy }

Configuration override for the bash tool.

type BetaManagedAgentsCustomSkill struct { Type: "custom"; SkillID; Version }

A resolved user-created custom skill.

Type BetaManagedAgentsCustomSkillType
SkillID string
Version string
type BetaManagedAgentsCustomSkillParams struct { Type: "custom"; SkillID; Version }

A user-created custom skill.

Type BetaManagedAgentsCustomSkillParamsType
SkillID string

Tagged ID of the custom skill (e.g., "skill_01XJ5...").

minLength1
maxLength64
Version string Optional

Version to pin. Defaults to latest if omitted.

minLength1
maxLength64
type BetaManagedAgentsCustomTool struct { Type: "custom"; Description; InputSchema; Name }

A custom tool as returned in API responses.

Type BetaManagedAgentsCustomToolType
Description string

JSON Schema for custom tool input parameters.

Type Object
Properties map[string, any] Optional
Required []string Optional
Name string
type BetaManagedAgentsCustomToolInputSchema struct { Type: "object"; Properties; Required }

JSON Schema for custom tool input parameters.

Type Object
Properties map[string, any] Optional
Required []string Optional
type BetaManagedAgentsCustomToolParams struct { Type: "custom"; Description; InputSchema; Name }

A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an agent.custom_tool_use event is emitted and the session goes idle, waiting for the client to provide the result via a user.custom_tool_result event.

Type BetaManagedAgentsCustomToolParamsType
Description string

Description of what the tool does, shown to the agent to help it decide when to use the tool.

minLength1

JSON Schema defining the expected input parameters for the tool.

Type Object
Properties map[string, any] Optional
Required []string Optional
Name string

Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.

minLength1
maxLength128
type BetaManagedAgentsEditToolConfig struct { Type: "edit"; Enabled; Name; PermissionPolicy }

Configuration for the edit tool.

Type Edit
Enabled bool
Name Edit
PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsEditToolConfigParams struct { Type: "edit"; Name; Enabled; PermissionPolicy }

Configuration override for the edit tool.

type BetaManagedAgentsEffortHigh struct { Type: "high" }

High effort. Favors reasoning depth.

Type BetaManagedAgentsEffortHighType
type BetaManagedAgentsEffortLow struct { Type: "low" }

Low effort. Favors latency over reasoning depth.

Type BetaManagedAgentsEffortLowType
type BetaManagedAgentsEffortMax struct { Type: "max" }

Maximum effort. Favors reasoning depth over latency.

Type BetaManagedAgentsEffortMaxType
type BetaManagedAgentsEffortMedium struct { Type: "medium" }

Medium effort. Balances latency and reasoning depth.

Type BetaManagedAgentsEffortMediumType
type BetaManagedAgentsEffortXhigh struct { Type: "xhigh" }

Extra-high effort. Not all models accept this level.

Type BetaManagedAgentsEffortXhighType
type BetaManagedAgentsExecutionIdentityUnion interface{…}

Execution principal for runs of this agent as returned in API responses.

One of the following:
type BetaManagedAgentsAWSRoleExecutionIdentity struct { Type: "aws_role"; RoleARN }

An AWS IAM role principal as returned in API responses.

Type AWSRole
RoleARN string

The IAM role's ARN.

type BetaManagedAgentsServiceAccountExecutionIdentity struct { Type: "service_account" }

The Anthropic-managed service account as returned in API responses.

Type ServiceAccount
type BetaManagedAgentsExecutionIdentityParamsUnion interface{…}

Execution principal for runs of this agent: service_account (the default) or aws_role.

One of the following:
type BetaManagedAgentsAWSRoleExecutionIdentityParams struct { Type: "aws_role"; RoleARN }

An AWS IAM role principal.

Type AWSRole
RoleARN string

The IAM role's ARN, e.g. "arn:aws:iam::123456789012:role/my-agent-runner". Maximum 2048 characters.

maxLength2048
type BetaManagedAgentsServiceAccountExecutionIdentityParams struct { Type: "service_account" }

The Anthropic-managed service account — the default execution principal. Carries no identifier.

Type ServiceAccount
type BetaManagedAgentsGlobToolConfig struct { Type: "glob"; Enabled; Name; PermissionPolicy }

Configuration for the glob tool.

Type Glob
Enabled bool
Name Glob
PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsGlobToolConfigParams struct { Type: "glob"; Name; Enabled; PermissionPolicy }

Configuration override for the glob tool.

type BetaManagedAgentsGrepToolConfig struct { Type: "grep"; Enabled; Name; PermissionPolicy }

Configuration for the grep tool.

Type Grep
Enabled bool
Name Grep
PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsGrepToolConfigParams struct { Type: "grep"; Name; Enabled; PermissionPolicy }

Configuration override for the grep tool.

type BetaManagedAgentsMCPServerURLDefinition struct { Type: "url"; Name; URL }

URL-based MCP server connection as returned in API responses.

Type BetaManagedAgentsMCPServerURLDefinitionType
Name string
URL string
type BetaManagedAgentsMCPToolConfig struct { Enabled; Name; PermissionPolicy }

Resolved configuration for a specific MCP tool.

Enabled bool
Name string
PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsMCPToolConfigParams struct { Name; Enabled; PermissionPolicy }

Configuration override for a specific MCP tool.

Name string

Name of the MCP tool to configure. 1-128 characters.

minLength1
maxLength128
Enabled bool Optional

Whether this tool is enabled. Overrides the default_config setting.

PermissionPolicy BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion Optional

Permission policy for this tool. Overrides the default_config setting.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsMCPToolset struct { Type: "mcp_toolset"; Configs; DefaultConfig; MCPServerName }
type BetaManagedAgentsMCPToolsetDefaultConfig struct { Enabled; PermissionPolicy }

Resolved default configuration for all tools from an MCP server.

Enabled bool
PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsMCPToolsetDefaultConfigParams struct { Enabled; PermissionPolicy }

Default configuration for all tools from an MCP server.

Enabled bool Optional

Whether tools are enabled by default. Defaults to true if not specified.

PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion Optional

Default permission policy for tools from this server.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsMCPToolsetParams struct { Type: "mcp_toolset"; MCPServerName; Configs; DefaultConfig }

Configuration for tools from an MCP server defined in mcp_servers.

type BetaManagedAgentsModel string

The model that will power your agent.

See models for additional details and options.

One of the following:
type BetaManagedAgentsModelConfig struct { ID; Effort; InferenceGeo; Speed }

Model identifier and configuration.

type BetaManagedAgentsModelConfigParams struct { ID; Effort; InferenceGeo; Speed }

An object that defines additional configuration control over model use

type BetaManagedAgentsMultiagentAdvisorUnion interface{…}

Whether the session's primary thread can consult an advisor model.

One of the following:
type BetaManagedAgentsMultiagentAdvisorEnabled struct { Type: "enabled"; Model }

The session's primary thread can consult model mid-turn.

Type Enabled
Model string

The advisor model id.

type BetaManagedAgentsMultiagentAdvisorDisabled struct { Type: "disabled" }

The agent has no advisor.

Type Disabled
type BetaManagedAgentsMultiagentAdvisorDisabled struct { Type: "disabled" }

The agent has no advisor.

Type Disabled
type BetaManagedAgentsMultiagentAdvisorDisabledParams struct { Type: "disabled" }

The agent has no advisor.

Type Disabled
type BetaManagedAgentsMultiagentAdvisorEnabled struct { Type: "enabled"; Model }

The session's primary thread can consult model mid-turn.

Type Enabled
Model string

The advisor model id.

type BetaManagedAgentsMultiagentAdvisorEnabledParams struct { Type: "enabled"; Model }

The session's primary thread can consult model mid-turn.

Type Enabled
Model string

A Claude model id. The model must be permitted as an advisor for this agent's model.

minLength1
maxLength256
type BetaManagedAgentsMultiagentAdvisorParamsUnion interface{…}

Whether the session's primary thread can consult an advisor model.

One of the following:
type BetaManagedAgentsMultiagentAdvisorEnabledParams struct { Type: "enabled"; Model }

The session's primary thread can consult model mid-turn.

Type Enabled
Model string

A Claude model id. The model must be permitted as an advisor for this agent's model.

minLength1
maxLength256
type BetaManagedAgentsMultiagentAdvisorDisabledParams struct { Type: "disabled" }

The agent has no advisor.

Type Disabled
type BetaManagedAgentsMultiagentCoordinator struct { Type: "coordinator"; Agents }

Resolved coordinator topology with a concrete agent roster.

Type BetaManagedAgentsMultiagentCoordinatorType
Agents []BetaManagedAgentsMultiagentCoordinatorAgentUnion

Agents the coordinator may spawn as session threads, each resolved to a specific version.

One of the following:
type BetaManagedAgentsAgentReference struct { Type: "agent"; ID; Version }

A resolved agent reference with a concrete version.

Type BetaManagedAgentsAgentReferenceType
ID string
Version int64
formatint32
type BetaManagedAgentsAdvisor struct { Type: "advisor"; Model }

Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

Type BetaManagedAgentsAdvisorType
Model string

The advisor model id.

type BetaManagedAgentsMultiagentCoordinatorParams struct { Type: "coordinator"; Agents }

A coordinator topology: the session's primary thread orchestrates work by spawning session threads, each running an agent drawn from the agents roster.

type BetaManagedAgentsMultiagentInlineAgentsUnion interface{…}

Whether the agent can define inline agents. The agent defines an inline agent itself, in a workflow run's plan or when it spawns a session thread, and the inline agent is not saved.

One of the following:
type BetaManagedAgentsMultiagentInlineAgentsEnabled struct { Type: "enabled" }

The agent can define inline agents.

Type Enabled
type BetaManagedAgentsMultiagentInlineAgentsDisabled struct { Type: "disabled" }

The agent cannot define inline agents.

Type Disabled
type BetaManagedAgentsMultiagentInlineAgentsDisabled struct { Type: "disabled" }

The agent cannot define inline agents.

Type Disabled
type BetaManagedAgentsMultiagentInlineAgentsDisabledParams struct { Type: "disabled" }

The agent cannot define inline agents.

Type Disabled
type BetaManagedAgentsMultiagentInlineAgentsEnabled struct { Type: "enabled" }

The agent can define inline agents.

Type Enabled
type BetaManagedAgentsMultiagentInlineAgentsEnabledParams struct { Type: "enabled" }

The agent can define inline agents.

Type Enabled
type BetaManagedAgentsMultiagentInlineAgentsParamsUnion interface{…}

Whether the agent can define inline agents. The agent defines an inline agent itself, in a workflow run's plan or when it spawns a session thread, and the inline agent is not saved.

One of the following:
type BetaManagedAgentsMultiagentInlineAgentsEnabledParams struct { Type: "enabled" }

The agent can define inline agents.

Type Enabled
type BetaManagedAgentsMultiagentInlineAgentsDisabledParams struct { Type: "disabled" }

The agent cannot define inline agents.

Type Disabled
type BetaManagedAgentsMultiagentPredefinedAgentParamsUnion interface{…}

One agent in a predefined_agents list. It is an agent ID string, an agent reference with an optional version, or self for the agent that owns this configuration.

One of the following:
string
type BetaManagedAgentsAgentParams struct { Type: "agent"; ID; Version }

Specification for an Agent. Provide a specific version or use the short-form agent="agent_id" for the most recent version

Type BetaManagedAgentsAgentParamsType
ID string

The agent ID.

minLength1
maxLength128
Version int64 Optional

The specific agent version to use. Omit to use the latest version. Must be at least 1 if specified.

formatint32
type BetaManagedAgentsMultiagentSelfParams struct { Type: "self" }

Sentinel roster entry meaning "the agent that owns this configuration". Resolved server-side to a concrete agent reference.

Type BetaManagedAgentsMultiagentSelfParamsType
type BetaManagedAgentsMultiagentSelfParams struct { Type: "self" }

Sentinel roster entry meaning "the agent that owns this configuration". Resolved server-side to a concrete agent reference.

Type BetaManagedAgentsMultiagentSelfParamsType
type BetaManagedAgentsMultiagentSubagentsUnion interface{…}

Whether the agent can spawn session threads.

One of the following:
type BetaManagedAgentsMultiagentSubagentsDisabled struct { Type: "disabled" }

The agent cannot spawn session threads.

Type Disabled
type BetaManagedAgentsMultiagentSubagentsDisabledParams struct { Type: "disabled" }

The agent cannot spawn session threads.

Type Disabled
type BetaManagedAgentsMultiagentSubagentsEnabled struct { Type: "enabled"; InlineAgents; PredefinedAgents }

The agent can spawn session threads.

Type Enabled

Whether the agent can define inline agents, which are not saved, when it spawns session threads.

One of the following:
type BetaManagedAgentsMultiagentInlineAgentsEnabled struct { Type: "enabled" }

The agent can define inline agents.

Type Enabled
type BetaManagedAgentsMultiagentInlineAgentsDisabled struct { Type: "disabled" }

The agent cannot define inline agents.

Type Disabled
PredefinedAgents []BetaManagedAgentsAgentReference

Predefined agents, which are saved agents that this agent can spawn as session threads, each resolved to a specific version.

Type BetaManagedAgentsAgentReferenceType
ID string
Version int64
formatint32
type BetaManagedAgentsMultiagentSubagentsEnabledParams struct { Type: "enabled"; InlineAgents; PredefinedAgents }

The agent can spawn session threads. Each thread runs a predefined agent, which is a saved agent in predefined_agents, or an inline agent, which the agent defines when it spawns the thread and which is not saved. If inline_agents is disabled, predefined_agents must name at least one agent.

type BetaManagedAgentsMultiagentSubagentsParamsUnion interface{…}

Whether the agent can spawn session threads.

One of the following:
type BetaManagedAgentsMultiagentSubagentsEnabledParams struct { Type: "enabled"; InlineAgents; PredefinedAgents }

The agent can spawn session threads. Each thread runs a predefined agent, which is a saved agent in predefined_agents, or an inline agent, which the agent defines when it spawns the thread and which is not saved. If inline_agents is disabled, predefined_agents must name at least one agent.

type BetaManagedAgentsMultiagentSubagentsDisabledParams struct { Type: "disabled" }

The agent cannot spawn session threads.

Type Disabled
type BetaManagedAgentsMultiagentWorkflowsUnion interface{…}

Whether the agent can start workflow runs.

One of the following:
type BetaManagedAgentsMultiagentWorkflowsDisabled struct { Type: "disabled" }

The agent cannot start workflow runs.

Type Disabled
type BetaManagedAgentsMultiagentWorkflowsDisabledParams struct { Type: "disabled" }

The agent cannot start workflow runs.

Type Disabled
type BetaManagedAgentsMultiagentWorkflowsEnabled struct { Type: "enabled"; InlineAgents; PredefinedAgents }

The agent can start workflow runs.

Type Enabled

Whether a run's plan can define inline agents, which are not saved.

One of the following:
type BetaManagedAgentsMultiagentInlineAgentsEnabled struct { Type: "enabled" }

The agent can define inline agents.

Type Enabled
type BetaManagedAgentsMultiagentInlineAgentsDisabled struct { Type: "disabled" }

The agent cannot define inline agents.

Type Disabled
PredefinedAgents []BetaManagedAgentsAgentReference

Predefined agents, which are saved agents that a run's plan can use, each resolved to a specific version.

Type BetaManagedAgentsAgentReferenceType
ID string
Version int64
formatint32
type BetaManagedAgentsMultiagentWorkflowsEnabledParams struct { Type: "enabled"; InlineAgents; PredefinedAgents }

The agent can start workflow runs. Each run follows a plan, a program that the agent writes. A plan can use predefined agents, which are the saved agents in predefined_agents, and inline agents, which it defines itself and which are not saved. If inline_agents is disabled, predefined_agents must name at least one agent.

type BetaManagedAgentsMultiagentWorkflowsParamsUnion interface{…}

Whether the agent can start workflow runs.

One of the following:
type BetaManagedAgentsMultiagentWorkflowsEnabledParams struct { Type: "enabled"; InlineAgents; PredefinedAgents }

The agent can start workflow runs. Each run follows a plan, a program that the agent writes. A plan can use predefined agents, which are the saved agents in predefined_agents, and inline agents, which it defines itself and which are not saved. If inline_agents is disabled, predefined_agents must name at least one agent.

type BetaManagedAgentsMultiagentWorkflowsDisabledParams struct { Type: "disabled" }

The agent cannot start workflow runs.

Type Disabled
type BetaManagedAgentsMultiagent20261001 struct { Type: "multiagent_20261001"; Advisor; Subagents; Workflows }

Resolved multiagent configuration with three members, each enabled or disabled on its own.

Type Multiagent20261001

Whether the session's primary thread can consult an advisor model.

One of the following:
type BetaManagedAgentsMultiagentAdvisorEnabled struct { Type: "enabled"; Model }

The session's primary thread can consult model mid-turn.

Type Enabled
Model string

The advisor model id.

type BetaManagedAgentsMultiagentAdvisorDisabled struct { Type: "disabled" }

The agent has no advisor.

Type Disabled

Whether the agent can spawn session threads.

One of the following:

Whether the agent can start workflow runs.

One of the following:
type BetaManagedAgentsMultiagent20261001Params struct { Type: "multiagent_20261001"; Advisor; Subagents; Workflows }

Multiagent configuration with three members, each enabled or disabled on its own. On an update, if the agent's stored multiagent also has type multiagent_20261001, this configuration is merged into the stored one, level by level, instead of replacing it. A key that the update omits keeps its stored value. A key sent as null takes its default, on create as well, so "workflows": null enables workflows. An object sent with a type other than the stored one replaces the stored object, and the keys that it omits take their defaults. A predefined_agents list that is sent replaces the stored list. Every object that is sent needs its type, and an enabled advisor needs its model. Other validation applies to the merged result.

type BetaManagedAgentsReadToolConfig struct { Type: "read"; Enabled; Name; PermissionPolicy }

Configuration for the read tool.

Type Read
Enabled bool
Name Read
PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsReadToolConfigParams struct { Type: "read"; Name; Enabled; PermissionPolicy }

Configuration override for the read tool.

type BetaManagedAgentsServiceAccountExecutionIdentity struct { Type: "service_account" }

The Anthropic-managed service account as returned in API responses.

Type ServiceAccount
type BetaManagedAgentsServiceAccountExecutionIdentityParams struct { Type: "service_account" }

The Anthropic-managed service account — the default execution principal. Carries no identifier.

Type ServiceAccount
type BetaManagedAgentsSessionThreadAgent struct { Type: "agent"; ID; Description; /* 8 more */ }

Resolved agent definition for a single session_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from Session.agent.

type BetaManagedAgentsSkillParamsUnion interface{…}

Skill to load in the session container.

One of the following:
type BetaManagedAgentsAnthropicSkillParams struct { Type: "anthropic"; SkillID; Version }

An Anthropic-managed skill.

Type BetaManagedAgentsAnthropicSkillParamsType
SkillID string

Identifier of the Anthropic skill (e.g., "xlsx").

minLength1
maxLength64
Version string Optional

Version to pin. Defaults to latest if omitted.

minLength1
maxLength64
type BetaManagedAgentsCustomSkillParams struct { Type: "custom"; SkillID; Version }

A user-created custom skill.

Type BetaManagedAgentsCustomSkillParamsType
SkillID string

Tagged ID of the custom skill (e.g., "skill_01XJ5...").

minLength1
maxLength64
Version string Optional

Version to pin. Defaults to latest if omitted.

minLength1
maxLength64
type BetaManagedAgentsURLMCPServerParams struct { Type: "url"; Name; URL }

URL-based MCP server connection.

Type BetaManagedAgentsURLMCPServerParamsType
Name string

Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.

minLength1
maxLength255
URL string

Endpoint URL for the MCP server.

maxLength2048
type BetaManagedAgentsUserLocation struct { Type: "approximate"; City; Country; /* 2 more */ }

Approximate user location for search result localization.

Type Approximate

Location precision. Only "approximate" is supported.

City string Optional

City name.

minLength1
maxLength255
Country string Optional

Two-letter ISO 3166-1 country code, uppercase.

Region string Optional

Region or state name.

minLength1
maxLength255
Timezone string Optional

IANA timezone identifier, e.g. "America/Los_Angeles".

minLength1
maxLength255
type BetaManagedAgentsWebFetchToolConfig struct { Type: "web_fetch"; Enabled; Name; /* 5 more */ }

Configuration for the web_fetch tool.

type BetaManagedAgentsWebFetchToolConfigParams struct { Type: "web_fetch"; Name; AllowedDomains; /* 5 more */ }

Configuration override for the web_fetch tool.

type BetaManagedAgentsWebFetchURLSourceAll struct { Type: "all" }

Every URL from this source may be fetched. This is the default.

Type All
type BetaManagedAgentsWebFetchURLSourceExcept struct { Type: "except"; Tools }

Every tool's results contribute URLs that may be fetched, except the named tools' results.

Type Except

The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

Type ToolReference

Must be "tool_reference".

Name string

Name of the tool. Compared exactly, so upper and lower case letters are different.

minLength1
maxLength128
type BetaManagedAgentsWebFetchURLSourceNone struct { Type: "none" }

This source contributes no URLs that may be fetched.

Type None
type BetaManagedAgentsWebFetchURLSourceOnly struct { Type: "only"; Tools }

Only the named tools' results contribute URLs that may be fetched.

Type Only

The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

Type ToolReference

Must be "tool_reference".

Name string

Name of the tool. Compared exactly, so upper and lower case letters are different.

minLength1
maxLength128
type BetaManagedAgentsWebFetchURLSourceShorthand string

String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

One of the following:
const BetaManagedAgentsWebFetchURLSourceShorthandAll BetaManagedAgentsWebFetchURLSourceShorthand = "all"
const BetaManagedAgentsWebFetchURLSourceShorthandNone BetaManagedAgentsWebFetchURLSourceShorthand = "none"
type BetaManagedAgentsWebFetchURLSourceToolFilterUnion interface{…}

Which tools' results contribute URLs that may be fetched.

One of the following:
type BetaManagedAgentsWebFetchURLSourceToolFilterParamsUnion interface{…}

Which tools' results contribute URLs that may be fetched. Accepts the string "all" or "none", or an object whose type is "all", "none", "only" or "except". Responses use the object form.

One of the following:
type BetaManagedAgentsWebFetchURLSourceShorthand string

String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

One of the following:
const BetaManagedAgentsWebFetchURLSourceShorthandAll BetaManagedAgentsWebFetchURLSourceShorthand = "all"
const BetaManagedAgentsWebFetchURLSourceShorthandNone BetaManagedAgentsWebFetchURLSourceShorthand = "none"
type BetaManagedAgentsWebFetchURLSourceToolFilterUnion interface{…}

Which tools' results contribute URLs that may be fetched.

One of the following:
type BetaManagedAgentsWebFetchURLSourceToolReference struct { Type: "tool_reference"; Name }

Names one tool in an only or except list.

Type ToolReference

Must be "tool_reference".

Name string

Name of the tool. Compared exactly, so upper and lower case letters are different.

minLength1
maxLength128
type BetaManagedAgentsWebFetchURLSourceUserInputUnion interface{…}

Whether URLs in the text of user messages may be fetched.

One of the following:
type BetaManagedAgentsWebFetchURLSourceAll struct { Type: "all" }

Every URL from this source may be fetched. This is the default.

Type All
type BetaManagedAgentsWebFetchURLSourceNone struct { Type: "none" }

This source contributes no URLs that may be fetched.

Type None
type BetaManagedAgentsWebFetchURLSourceUserInputParamsUnion interface{…}

Whether URLs in the text of user messages may be fetched. Accepts the string "all" or "none", or the object {"type": "all"} or {"type": "none"}. Responses use the object form.

One of the following:
type BetaManagedAgentsWebFetchURLSourceShorthand string

String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

One of the following:
const BetaManagedAgentsWebFetchURLSourceShorthandAll BetaManagedAgentsWebFetchURLSourceShorthand = "all"
const BetaManagedAgentsWebFetchURLSourceShorthandNone BetaManagedAgentsWebFetchURLSourceShorthand = "none"
type BetaManagedAgentsWebFetchURLSourceUserInputUnion interface{…}

Whether URLs in the text of user messages may be fetched.

One of the following:
type BetaManagedAgentsWebFetchURLSourceAll struct { Type: "all" }

Every URL from this source may be fetched. This is the default.

Type All
type BetaManagedAgentsWebFetchURLSourceNone struct { Type: "none" }

This source contributes no URLs that may be fetched.

Type None
type BetaManagedAgentsWebFetchURLSources struct { ClientToolResults; ServerToolResults; UserInput }

Which sources contribute URLs the web_fetch tool may fetch. A key that is null was not set and allows every URL from that source.

Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

One of the following:

Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

One of the following:

Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

One of the following:
type BetaManagedAgentsWebFetchURLSourceAll struct { Type: "all" }

Every URL from this source may be fetched. This is the default.

Type All
type BetaManagedAgentsWebFetchURLSourceNone struct { Type: "none" }

This source contributes no URLs that may be fetched.

Type None
type BetaManagedAgentsWebFetchURLSourcesParams struct { ClientToolResults; ServerToolResults; UserInput }

Which sources contribute URLs the web_fetch tool may fetch. When web_fetch is limited to URLs the conversation has already shown the model (in a user message, a custom tool's result, or an earlier web_search or web_fetch result), each key narrows one of those sources and defaults to "all". Setting all three keys to "none" is rejected.

type BetaManagedAgentsWebSearchToolConfig struct { Type: "web_search"; Enabled; Name; /* 4 more */ }

Configuration for the web_search tool.

type BetaManagedAgentsWebSearchToolConfigParams struct { Type: "web_search"; Name; AllowedDomains; /* 4 more */ }

Configuration override for the web_search tool.

type BetaManagedAgentsWriteToolConfig struct { Type: "write"; Enabled; Name; PermissionPolicy }

Configuration for the write tool.

Type Write
Enabled bool
Name Write
PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion

Permission policy for tool execution.

One of the following:
type BetaManagedAgentsAlwaysAllowPolicy struct { Type: "always_allow" }

Tool calls are automatically approved without user confirmation.

Type BetaManagedAgentsAlwaysAllowPolicyType
type BetaManagedAgentsAlwaysAskPolicy struct { Type: "always_ask" }

Tool calls require user confirmation before execution.

Type BetaManagedAgentsAlwaysAskPolicyType
type BetaManagedAgentsAutoPolicy struct { Type: "auto" }

The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

Type Auto
type BetaManagedAgentsWriteToolConfigParams struct { Type: "write"; Name; Enabled; PermissionPolicy }

Configuration override for the write tool.

AgenVersi

Daftar Versi Agen
client.Beta.Agents.Versions.List(ctx, agentID, params) (*PageCursor[BetaManagedAgentsAgent], error)
GET/v1/agents/{agent_id}/versions