Threads
List Session Threads
get /v1/sessions/{session_id}/threads
List Session Threads
Path Parameters
session_id: string
Query Parameters
-
limit: optional numberMaximum results per page. Defaults to 1000.
-
page: optional stringOpaque pagination cursor from a previous response's next_page. Forward-only.
Header Parameters
-
"anthropic-beta": optional array of AnthropicBetaOptional header to specify the beta version(s) you want to use.
-
string -
"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 22 more-
"message-batches-2024-09-24" -
"prompt-caching-2024-07-31" -
"computer-use-2024-10-22" -
"computer-use-2025-01-24" -
"pdfs-2024-09-25" -
"token-counting-2024-11-01" -
"token-efficient-tools-2025-02-19" -
"output-128k-2025-02-19" -
"files-api-2025-04-14" -
"mcp-client-2025-04-04" -
"mcp-client-2025-11-20" -
"dev-full-thinking-2025-05-14" -
"interleaved-thinking-2025-05-14" -
"code-execution-2025-05-22" -
"extended-cache-ttl-2025-04-11" -
"context-1m-2025-08-07" -
"context-management-2025-06-27" -
"model-context-window-exceeded-2025-08-26" -
"skills-2025-10-02" -
"fast-mode-2026-02-01" -
"output-300k-2026-03-24" -
"user-profiles-2026-03-24" -
"advisor-tool-2026-03-01" -
"managed-agents-2026-04-01" -
"cache-diagnosis-2026-04-07"
-
-
Returns
-
data: optional array of BetaManagedAgentsSessionThreadThreads in the session, primary first then children in spawn order.
-
id: stringUnique identifier for this thread.
-
agent: BetaManagedAgentsSessionThreadAgentResolved
agentdefinition for a singlesession_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it fromSession.agent.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url""url"
-
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
id: BetaManagedAgentsModelThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7" or "claude-opus-4-6" or "claude-sonnet-4-6" or 6 moreThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7"Frontier intelligence for long-running agents and coding
-
"claude-opus-4-6"Most intelligent model for building agents and coding
-
"claude-sonnet-4-6"Best combination of speed and intelligence
-
"claude-haiku-4-5"Fastest model with near-frontier intelligence
-
"claude-haiku-4-5-20251001"Fastest model with near-frontier intelligence
-
"claude-opus-4-5"Premium model combining maximum intelligence with practical performance
-
"claude-opus-4-5-20251101"Premium model combining maximum intelligence with practical performance
-
"claude-sonnet-4-5"High-performance model for agents and coding
-
"claude-sonnet-4-5-20250929"High-performance model for agents and coding
-
-
string
-
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
skill_id: string -
type: "anthropic""anthropic"
-
version: string
-
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
skill_id: string -
type: "custom""custom"
-
version: string
-
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type }-
configs: array of BetaManagedAgentsAgentToolConfig-
enabled: boolean -
name: "bash" or "edit" or "read" or 5 moreBuilt-in agent tool identifier.
-
"bash" -
"edit" -
"read" -
"write" -
"glob" -
"grep" -
"web_fetch" -
"web_search"
-
-
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
type: "always_allow""always_allow"
-
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
type: "always_ask""always_ask"
-
-
-
-
default_config: BetaManagedAgentsAgentToolsetDefaultConfigResolved default configuration for agent tools.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
type: "agent_toolset_20260401""agent_toolset_20260401"
-
-
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type }-
configs: array of BetaManagedAgentsMCPToolConfig-
enabled: boolean -
name: string -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
default_config: BetaManagedAgentsMCPToolsetDefaultConfigResolved default configuration for all tools from an MCP server.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
mcp_server_name: string -
type: "mcp_toolset""mcp_toolset"
-
-
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
description: string -
input_schema: BetaManagedAgentsCustomToolInputSchemaJSON Schema for custom tool input parameters.
-
properties: optional map[unknown]JSON Schema properties defining the tool's input parameters.
-
required: optional array of stringList of required property names.
-
type: optional "object"Must be 'object' for tool input schemas.
"object"
-
-
name: string -
type: "custom""custom"
-
-
-
type: "agent""agent"
-
version: number
-
-
archived_at: stringA timestamp in RFC 3339 format
-
created_at: stringA timestamp in RFC 3339 format
-
parent_thread_id: stringParent thread that spawned this thread. Null for the primary thread.
-
session_id: stringThe session this thread belongs to.
-
stats: BetaManagedAgentsSessionThreadStatsTiming statistics for a session thread.
-
active_seconds: optional numberCumulative time in seconds the thread spent actively running. Excludes idle time.
-
duration_seconds: optional numberElapsed time since thread creation in seconds. For archived threads, frozen at the final update.
-
startup_seconds: optional numberTime in seconds for the thread to begin running. Zero for child threads, which start immediately.
-
-
status: BetaManagedAgentsSessionThreadStatusSessionThreadStatus enum
-
"running" -
"idle" -
"rescheduling" -
"terminated"
-
-
type: "session_thread""session_thread"
-
updated_at: stringA timestamp in RFC 3339 format
-
usage: BetaManagedAgentsSessionThreadUsageCumulative token usage for a session thread across all turns.
-
cache_creation: optional BetaManagedAgentsCacheCreationUsagePrompt-cache creation token usage broken down by cache lifetime.
-
ephemeral_1h_input_tokens: optional numberTokens used to create 1-hour ephemeral cache entries.
-
ephemeral_5m_input_tokens: optional numberTokens used to create 5-minute ephemeral cache entries.
-
-
cache_read_input_tokens: optional numberTotal tokens read from prompt cache.
-
input_tokens: optional numberTotal input tokens consumed across all turns.
-
output_tokens: optional numberTotal output tokens generated across all turns.
-
-
-
next_page: optional stringOpaque cursor for the next page. Null when no more results.
Example
curl https://api.anthropic.com/v1/sessions/$SESSION_ID/threads \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: managed-agents-2026-04-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
Response
{
"data": [
{
"id": "sthr_011CZkZVWa6oIjw0rgXZpnBt",
"agent": {
"id": "agent_011CZkYqphY8vELVzwCUpqiQ",
"description": "A focused research subagent.",
"mcp_servers": [
{
"name": "example-mcp",
"type": "url",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"model": {
"id": "claude-sonnet-4-6",
"speed": "standard"
},
"name": "Researcher",
"skills": [
{
"skill_id": "xlsx",
"type": "anthropic",
"version": "1"
}
],
"system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
"tools": [
{
"configs": [
{
"enabled": true,
"name": "bash",
"permission_policy": {
"type": "always_allow"
}
}
],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"type": "agent_toolset_20260401"
}
],
"type": "agent",
"version": 1
},
"archived_at": null,
"created_at": "2026-03-15T10:00:00Z",
"parent_thread_id": null,
"session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"stats": {
"active_seconds": 0,
"duration_seconds": 0,
"startup_seconds": 0
},
"status": "idle",
"type": "session_thread",
"updated_at": "2026-03-15T10:00:00Z",
"usage": {
"cache_creation": {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
},
"cache_read_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0
}
}
],
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
Get Session Thread
get /v1/sessions/{session_id}/threads/{thread_id}
Get Session Thread
Path Parameters
-
session_id: string -
thread_id: string
Header Parameters
-
"anthropic-beta": optional array of AnthropicBetaOptional header to specify the beta version(s) you want to use.
-
string -
"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 22 more-
"message-batches-2024-09-24" -
"prompt-caching-2024-07-31" -
"computer-use-2024-10-22" -
"computer-use-2025-01-24" -
"pdfs-2024-09-25" -
"token-counting-2024-11-01" -
"token-efficient-tools-2025-02-19" -
"output-128k-2025-02-19" -
"files-api-2025-04-14" -
"mcp-client-2025-04-04" -
"mcp-client-2025-11-20" -
"dev-full-thinking-2025-05-14" -
"interleaved-thinking-2025-05-14" -
"code-execution-2025-05-22" -
"extended-cache-ttl-2025-04-11" -
"context-1m-2025-08-07" -
"context-management-2025-06-27" -
"model-context-window-exceeded-2025-08-26" -
"skills-2025-10-02" -
"fast-mode-2026-02-01" -
"output-300k-2026-03-24" -
"user-profiles-2026-03-24" -
"advisor-tool-2026-03-01" -
"managed-agents-2026-04-01" -
"cache-diagnosis-2026-04-07"
-
-
Returns
-
BetaManagedAgentsSessionThread object { id, agent, archived_at, 8 more }An execution thread within a
session. Each session has one primary thread plus zero or more child threads spawned by the coordinator.-
id: stringUnique identifier for this thread.
-
agent: BetaManagedAgentsSessionThreadAgentResolved
agentdefinition for a singlesession_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it fromSession.agent.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url""url"
-
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
id: BetaManagedAgentsModelThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7" or "claude-opus-4-6" or "claude-sonnet-4-6" or 6 moreThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7"Frontier intelligence for long-running agents and coding
-
"claude-opus-4-6"Most intelligent model for building agents and coding
-
"claude-sonnet-4-6"Best combination of speed and intelligence
-
"claude-haiku-4-5"Fastest model with near-frontier intelligence
-
"claude-haiku-4-5-20251001"Fastest model with near-frontier intelligence
-
"claude-opus-4-5"Premium model combining maximum intelligence with practical performance
-
"claude-opus-4-5-20251101"Premium model combining maximum intelligence with practical performance
-
"claude-sonnet-4-5"High-performance model for agents and coding
-
"claude-sonnet-4-5-20250929"High-performance model for agents and coding
-
-
string
-
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
skill_id: string -
type: "anthropic""anthropic"
-
version: string
-
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
skill_id: string -
type: "custom""custom"
-
version: string
-
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type }-
configs: array of BetaManagedAgentsAgentToolConfig-
enabled: boolean -
name: "bash" or "edit" or "read" or 5 moreBuilt-in agent tool identifier.
-
"bash" -
"edit" -
"read" -
"write" -
"glob" -
"grep" -
"web_fetch" -
"web_search"
-
-
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
type: "always_allow""always_allow"
-
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
type: "always_ask""always_ask"
-
-
-
-
default_config: BetaManagedAgentsAgentToolsetDefaultConfigResolved default configuration for agent tools.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
type: "agent_toolset_20260401""agent_toolset_20260401"
-
-
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type }-
configs: array of BetaManagedAgentsMCPToolConfig-
enabled: boolean -
name: string -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
default_config: BetaManagedAgentsMCPToolsetDefaultConfigResolved default configuration for all tools from an MCP server.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
mcp_server_name: string -
type: "mcp_toolset""mcp_toolset"
-
-
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
description: string -
input_schema: BetaManagedAgentsCustomToolInputSchemaJSON Schema for custom tool input parameters.
-
properties: optional map[unknown]JSON Schema properties defining the tool's input parameters.
-
required: optional array of stringList of required property names.
-
type: optional "object"Must be 'object' for tool input schemas.
"object"
-
-
name: string -
type: "custom""custom"
-
-
-
type: "agent""agent"
-
version: number
-
-
archived_at: stringA timestamp in RFC 3339 format
-
created_at: stringA timestamp in RFC 3339 format
-
parent_thread_id: stringParent thread that spawned this thread. Null for the primary thread.
-
session_id: stringThe session this thread belongs to.
-
stats: BetaManagedAgentsSessionThreadStatsTiming statistics for a session thread.
-
active_seconds: optional numberCumulative time in seconds the thread spent actively running. Excludes idle time.
-
duration_seconds: optional numberElapsed time since thread creation in seconds. For archived threads, frozen at the final update.
-
startup_seconds: optional numberTime in seconds for the thread to begin running. Zero for child threads, which start immediately.
-
-
status: BetaManagedAgentsSessionThreadStatusSessionThreadStatus enum
-
"running" -
"idle" -
"rescheduling" -
"terminated"
-
-
type: "session_thread""session_thread"
-
updated_at: stringA timestamp in RFC 3339 format
-
usage: BetaManagedAgentsSessionThreadUsageCumulative token usage for a session thread across all turns.
-
cache_creation: optional BetaManagedAgentsCacheCreationUsagePrompt-cache creation token usage broken down by cache lifetime.
-
ephemeral_1h_input_tokens: optional numberTokens used to create 1-hour ephemeral cache entries.
-
ephemeral_5m_input_tokens: optional numberTokens used to create 5-minute ephemeral cache entries.
-
-
cache_read_input_tokens: optional numberTotal tokens read from prompt cache.
-
input_tokens: optional numberTotal input tokens consumed across all turns.
-
output_tokens: optional numberTotal output tokens generated across all turns.
-
-
Example
curl https://api.anthropic.com/v1/sessions/$SESSION_ID/threads/$THREAD_ID \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: managed-agents-2026-04-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
Response
{
"id": "sthr_011CZkZVWa6oIjw0rgXZpnBt",
"agent": {
"id": "agent_011CZkYqphY8vELVzwCUpqiQ",
"description": "A focused research subagent.",
"mcp_servers": [
{
"name": "example-mcp",
"type": "url",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"model": {
"id": "claude-sonnet-4-6",
"speed": "standard"
},
"name": "Researcher",
"skills": [
{
"skill_id": "xlsx",
"type": "anthropic",
"version": "1"
}
],
"system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
"tools": [
{
"configs": [
{
"enabled": true,
"name": "bash",
"permission_policy": {
"type": "always_allow"
}
}
],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"type": "agent_toolset_20260401"
}
],
"type": "agent",
"version": 1
},
"archived_at": null,
"created_at": "2026-03-15T10:00:00Z",
"parent_thread_id": null,
"session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"stats": {
"active_seconds": 0,
"duration_seconds": 0,
"startup_seconds": 0
},
"status": "idle",
"type": "session_thread",
"updated_at": "2026-03-15T10:00:00Z",
"usage": {
"cache_creation": {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
},
"cache_read_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0
}
}
Archive Session Thread
post /v1/sessions/{session_id}/threads/{thread_id}/archive
Archive Session Thread
Path Parameters
-
session_id: string -
thread_id: string
Header Parameters
-
"anthropic-beta": optional array of AnthropicBetaOptional header to specify the beta version(s) you want to use.
-
string -
"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 22 more-
"message-batches-2024-09-24" -
"prompt-caching-2024-07-31" -
"computer-use-2024-10-22" -
"computer-use-2025-01-24" -
"pdfs-2024-09-25" -
"token-counting-2024-11-01" -
"token-efficient-tools-2025-02-19" -
"output-128k-2025-02-19" -
"files-api-2025-04-14" -
"mcp-client-2025-04-04" -
"mcp-client-2025-11-20" -
"dev-full-thinking-2025-05-14" -
"interleaved-thinking-2025-05-14" -
"code-execution-2025-05-22" -
"extended-cache-ttl-2025-04-11" -
"context-1m-2025-08-07" -
"context-management-2025-06-27" -
"model-context-window-exceeded-2025-08-26" -
"skills-2025-10-02" -
"fast-mode-2026-02-01" -
"output-300k-2026-03-24" -
"user-profiles-2026-03-24" -
"advisor-tool-2026-03-01" -
"managed-agents-2026-04-01" -
"cache-diagnosis-2026-04-07"
-
-
Returns
-
BetaManagedAgentsSessionThread object { id, agent, archived_at, 8 more }An execution thread within a
session. Each session has one primary thread plus zero or more child threads spawned by the coordinator.-
id: stringUnique identifier for this thread.
-
agent: BetaManagedAgentsSessionThreadAgentResolved
agentdefinition for a singlesession_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it fromSession.agent.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url""url"
-
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
id: BetaManagedAgentsModelThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7" or "claude-opus-4-6" or "claude-sonnet-4-6" or 6 moreThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7"Frontier intelligence for long-running agents and coding
-
"claude-opus-4-6"Most intelligent model for building agents and coding
-
"claude-sonnet-4-6"Best combination of speed and intelligence
-
"claude-haiku-4-5"Fastest model with near-frontier intelligence
-
"claude-haiku-4-5-20251001"Fastest model with near-frontier intelligence
-
"claude-opus-4-5"Premium model combining maximum intelligence with practical performance
-
"claude-opus-4-5-20251101"Premium model combining maximum intelligence with practical performance
-
"claude-sonnet-4-5"High-performance model for agents and coding
-
"claude-sonnet-4-5-20250929"High-performance model for agents and coding
-
-
string
-
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
skill_id: string -
type: "anthropic""anthropic"
-
version: string
-
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
skill_id: string -
type: "custom""custom"
-
version: string
-
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type }-
configs: array of BetaManagedAgentsAgentToolConfig-
enabled: boolean -
name: "bash" or "edit" or "read" or 5 moreBuilt-in agent tool identifier.
-
"bash" -
"edit" -
"read" -
"write" -
"glob" -
"grep" -
"web_fetch" -
"web_search"
-
-
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
type: "always_allow""always_allow"
-
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
type: "always_ask""always_ask"
-
-
-
-
default_config: BetaManagedAgentsAgentToolsetDefaultConfigResolved default configuration for agent tools.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
type: "agent_toolset_20260401""agent_toolset_20260401"
-
-
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type }-
configs: array of BetaManagedAgentsMCPToolConfig-
enabled: boolean -
name: string -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
default_config: BetaManagedAgentsMCPToolsetDefaultConfigResolved default configuration for all tools from an MCP server.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
mcp_server_name: string -
type: "mcp_toolset""mcp_toolset"
-
-
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
description: string -
input_schema: BetaManagedAgentsCustomToolInputSchemaJSON Schema for custom tool input parameters.
-
properties: optional map[unknown]JSON Schema properties defining the tool's input parameters.
-
required: optional array of stringList of required property names.
-
type: optional "object"Must be 'object' for tool input schemas.
"object"
-
-
name: string -
type: "custom""custom"
-
-
-
type: "agent""agent"
-
version: number
-
-
archived_at: stringA timestamp in RFC 3339 format
-
created_at: stringA timestamp in RFC 3339 format
-
parent_thread_id: stringParent thread that spawned this thread. Null for the primary thread.
-
session_id: stringThe session this thread belongs to.
-
stats: BetaManagedAgentsSessionThreadStatsTiming statistics for a session thread.
-
active_seconds: optional numberCumulative time in seconds the thread spent actively running. Excludes idle time.
-
duration_seconds: optional numberElapsed time since thread creation in seconds. For archived threads, frozen at the final update.
-
startup_seconds: optional numberTime in seconds for the thread to begin running. Zero for child threads, which start immediately.
-
-
status: BetaManagedAgentsSessionThreadStatusSessionThreadStatus enum
-
"running" -
"idle" -
"rescheduling" -
"terminated"
-
-
type: "session_thread""session_thread"
-
updated_at: stringA timestamp in RFC 3339 format
-
usage: BetaManagedAgentsSessionThreadUsageCumulative token usage for a session thread across all turns.
-
cache_creation: optional BetaManagedAgentsCacheCreationUsagePrompt-cache creation token usage broken down by cache lifetime.
-
ephemeral_1h_input_tokens: optional numberTokens used to create 1-hour ephemeral cache entries.
-
ephemeral_5m_input_tokens: optional numberTokens used to create 5-minute ephemeral cache entries.
-
-
cache_read_input_tokens: optional numberTotal tokens read from prompt cache.
-
input_tokens: optional numberTotal input tokens consumed across all turns.
-
output_tokens: optional numberTotal output tokens generated across all turns.
-
-
Example
curl https://api.anthropic.com/v1/sessions/$SESSION_ID/threads/$THREAD_ID/archive \
-X POST \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: managed-agents-2026-04-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
Response
{
"id": "sthr_011CZkZVWa6oIjw0rgXZpnBt",
"agent": {
"id": "agent_011CZkYqphY8vELVzwCUpqiQ",
"description": "A focused research subagent.",
"mcp_servers": [
{
"name": "example-mcp",
"type": "url",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"model": {
"id": "claude-sonnet-4-6",
"speed": "standard"
},
"name": "Researcher",
"skills": [
{
"skill_id": "xlsx",
"type": "anthropic",
"version": "1"
}
],
"system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
"tools": [
{
"configs": [
{
"enabled": true,
"name": "bash",
"permission_policy": {
"type": "always_allow"
}
}
],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"type": "agent_toolset_20260401"
}
],
"type": "agent",
"version": 1
},
"archived_at": null,
"created_at": "2026-03-15T10:00:00Z",
"parent_thread_id": null,
"session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"stats": {
"active_seconds": 0,
"duration_seconds": 0,
"startup_seconds": 0
},
"status": "idle",
"type": "session_thread",
"updated_at": "2026-03-15T10:00:00Z",
"usage": {
"cache_creation": {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
},
"cache_read_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0
}
}
Domain Types
Beta Managed Agents Session Thread
-
BetaManagedAgentsSessionThread object { id, agent, archived_at, 8 more }An execution thread within a
session. Each session has one primary thread plus zero or more child threads spawned by the coordinator.-
id: stringUnique identifier for this thread.
-
agent: BetaManagedAgentsSessionThreadAgentResolved
agentdefinition for a singlesession_thread. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it fromSession.agent.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url""url"
-
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
id: BetaManagedAgentsModelThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7" or "claude-opus-4-6" or "claude-sonnet-4-6" or 6 moreThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7"Frontier intelligence for long-running agents and coding
-
"claude-opus-4-6"Most intelligent model for building agents and coding
-
"claude-sonnet-4-6"Best combination of speed and intelligence
-
"claude-haiku-4-5"Fastest model with near-frontier intelligence
-
"claude-haiku-4-5-20251001"Fastest model with near-frontier intelligence
-
"claude-opus-4-5"Premium model combining maximum intelligence with practical performance
-
"claude-opus-4-5-20251101"Premium model combining maximum intelligence with practical performance
-
"claude-sonnet-4-5"High-performance model for agents and coding
-
"claude-sonnet-4-5-20250929"High-performance model for agents and coding
-
-
string
-
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
skill_id: string -
type: "anthropic""anthropic"
-
version: string
-
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
skill_id: string -
type: "custom""custom"
-
version: string
-
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type }-
configs: array of BetaManagedAgentsAgentToolConfig-
enabled: boolean -
name: "bash" or "edit" or "read" or 5 moreBuilt-in agent tool identifier.
-
"bash" -
"edit" -
"read" -
"write" -
"glob" -
"grep" -
"web_fetch" -
"web_search"
-
-
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
type: "always_allow""always_allow"
-
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
type: "always_ask""always_ask"
-
-
-
-
default_config: BetaManagedAgentsAgentToolsetDefaultConfigResolved default configuration for agent tools.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
type: "agent_toolset_20260401""agent_toolset_20260401"
-
-
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type }-
configs: array of BetaManagedAgentsMCPToolConfig-
enabled: boolean -
name: string -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
default_config: BetaManagedAgentsMCPToolsetDefaultConfigResolved default configuration for all tools from an MCP server.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
mcp_server_name: string -
type: "mcp_toolset""mcp_toolset"
-
-
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
description: string -
input_schema: BetaManagedAgentsCustomToolInputSchemaJSON Schema for custom tool input parameters.
-
properties: optional map[unknown]JSON Schema properties defining the tool's input parameters.
-
required: optional array of stringList of required property names.
-
type: optional "object"Must be 'object' for tool input schemas.
"object"
-
-
name: string -
type: "custom""custom"
-
-
-
type: "agent""agent"
-
version: number
-
-
archived_at: stringA timestamp in RFC 3339 format
-
created_at: stringA timestamp in RFC 3339 format
-
parent_thread_id: stringParent thread that spawned this thread. Null for the primary thread.
-
session_id: stringThe session this thread belongs to.
-
stats: BetaManagedAgentsSessionThreadStatsTiming statistics for a session thread.
-
active_seconds: optional numberCumulative time in seconds the thread spent actively running. Excludes idle time.
-
duration_seconds: optional numberElapsed time since thread creation in seconds. For archived threads, frozen at the final update.
-
startup_seconds: optional numberTime in seconds for the thread to begin running. Zero for child threads, which start immediately.
-
-
status: BetaManagedAgentsSessionThreadStatusSessionThreadStatus enum
-
"running" -
"idle" -
"rescheduling" -
"terminated"
-
-
type: "session_thread""session_thread"
-
updated_at: stringA timestamp in RFC 3339 format
-
usage: BetaManagedAgentsSessionThreadUsageCumulative token usage for a session thread across all turns.
-
cache_creation: optional BetaManagedAgentsCacheCreationUsagePrompt-cache creation token usage broken down by cache lifetime.
-
ephemeral_1h_input_tokens: optional numberTokens used to create 1-hour ephemeral cache entries.
-
ephemeral_5m_input_tokens: optional numberTokens used to create 5-minute ephemeral cache entries.
-
-
cache_read_input_tokens: optional numberTotal tokens read from prompt cache.
-
input_tokens: optional numberTotal input tokens consumed across all turns.
-
output_tokens: optional numberTotal output tokens generated across all turns.
-
-
Beta Managed Agents Session Thread Stats
-
BetaManagedAgentsSessionThreadStats object { active_seconds, duration_seconds, startup_seconds }Timing statistics for a session thread.
-
active_seconds: optional numberCumulative time in seconds the thread spent actively running. Excludes idle time.
-
duration_seconds: optional numberElapsed time since thread creation in seconds. For archived threads, frozen at the final update.
-
startup_seconds: optional numberTime in seconds for the thread to begin running. Zero for child threads, which start immediately.
-
Beta Managed Agents Session Thread Status
-
BetaManagedAgentsSessionThreadStatus = "running" or "idle" or "rescheduling" or "terminated"SessionThreadStatus enum
-
"running" -
"idle" -
"rescheduling" -
"terminated"
-
Beta Managed Agents Session Thread Usage
-
BetaManagedAgentsSessionThreadUsage object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }Cumulative token usage for a session thread across all turns.
-
cache_creation: optional BetaManagedAgentsCacheCreationUsagePrompt-cache creation token usage broken down by cache lifetime.
-
ephemeral_1h_input_tokens: optional numberTokens used to create 1-hour ephemeral cache entries.
-
ephemeral_5m_input_tokens: optional numberTokens used to create 5-minute ephemeral cache entries.
-
-
cache_read_input_tokens: optional numberTotal tokens read from prompt cache.
-
input_tokens: optional numberTotal input tokens consumed across all turns.
-
output_tokens: optional numberTotal output tokens generated across all turns.
-
Beta Managed Agents Stream Session Thread Events
-
BetaManagedAgentsStreamSessionThreadEvents = BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 30 moreServer-sent event in a single thread's stream.
-
BetaManagedAgentsUserMessageEvent object { id, content, type, processed_at }A user message event in the session conversation.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockArray of content blocks comprising the user message.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
text: stringThe text content.
-
type: "text""text"
-
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSourceUnion type for image source variants.
-
BetaManagedAgentsBase64ImageSource object { data, media_type, type }Base64-encoded image data.
-
data: stringBase64-encoded image data.
-
media_type: stringMIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
-
type: "base64""base64"
-
-
BetaManagedAgentsURLImageSource object { type, url }Image referenced by URL.
-
type: "url""url"
-
url: stringURL of the image to fetch.
-
-
BetaManagedAgentsFileImageSource object { file_id, type }Image referenced by file ID.
-
file_id: stringID of a previously uploaded file.
-
type: "file""file"
-
-
-
type: "image""image"
-
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSourceUnion type for document source variants.
-
BetaManagedAgentsBase64DocumentSource object { data, media_type, type }Base64-encoded document data.
-
data: stringBase64-encoded document data.
-
media_type: stringMIME type of the document (e.g., "application/pdf").
-
type: "base64""base64"
-
-
BetaManagedAgentsPlainTextDocumentSource object { data, media_type, type }Plain text document content.
-
data: stringThe plain text content.
-
media_type: "text/plain"MIME type of the text content. Must be "text/plain".
"text/plain"
-
type: "text""text"
-
-
BetaManagedAgentsURLDocumentSource object { type, url }Document referenced by URL.
-
type: "url""url"
-
url: stringURL of the document to fetch.
-
-
BetaManagedAgentsFileDocumentSource object { file_id, type }Document referenced by file ID.
-
file_id: stringID of a previously uploaded file.
-
type: "file""file"
-
-
-
type: "document""document"
-
context: optional stringAdditional context about the document for the model.
-
title: optional stringThe title of the document.
-
-
-
type: "user.message""user.message"
-
processed_at: optional stringA timestamp in RFC 3339 format
-
-
BetaManagedAgentsUserInterruptEvent object { id, type, processed_at, session_thread_id }An interrupt event that pauses agent execution and returns control to the user.
-
id: stringUnique identifier for this event.
-
type: "user.interrupt""user.interrupt"
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringIf absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.
-
-
BetaManagedAgentsUserToolConfirmationEvent object { id, result, tool_use_id, 4 more }A tool confirmation event that approves or denies a pending tool execution.
-
id: stringUnique identifier for this event.
-
result: "allow" or "deny"UserToolConfirmationResult enum
-
"allow" -
"deny"
-
-
tool_use_id: stringThe id of the
agent.tool_useoragent.mcp_tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.tool_confirmation""user.tool_confirmation"
-
deny_message: optional stringOptional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringWhen set, the confirmation routes to this subagent's thread rather than the primary. Echo this from the
session_thread_idon theagent.tool_useoragent.mcp_tool_useevent that prompted the approval.
-
-
BetaManagedAgentsUserCustomToolResultEvent object { id, custom_tool_use_id, type, 4 more }Event sent by the client providing the result of a custom tool execution.
-
id: stringUnique identifier for this event.
-
custom_tool_use_id: stringThe id of the
agent.custom_tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.custom_tool_result""user.custom_tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
citations: BetaManagedAgentsSearchResultCitationsCitation settings for a search result.
-
enabled: booleanWhether citations are enabled for this search result.
-
-
content: array of BetaManagedAgentsSearchResultContentArray of text content blocks from the search result.
-
text: stringThe text content.
-
type: "text""text"
-
-
source: stringThe URL source of the search result.
-
title: stringThe title of the search result.
-
type: "search_result""search_result"
-
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringRoutes this result to a subagent thread. Copy from the
agent.custom_tool_useevent'ssession_thread_id.
-
-
BetaManagedAgentsAgentCustomToolUseEvent object { id, input, name, 3 more }Event emitted when the agent calls a custom tool. The session goes idle until the client sends a
user.custom_tool_resultevent with the result.-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
name: stringName of the custom tool being called.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.custom_tool_use""agent.custom_tool_use"
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.custom_tool_resultevent to route the result back.
-
-
BetaManagedAgentsAgentMessageEvent object { id, content, processed_at, type }An agent response event in the session conversation.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlockArray of text blocks comprising the agent response.
-
text: stringThe text content.
-
type: "text"
-
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.message""agent.message"
-
-
BetaManagedAgentsAgentThinkingEvent object { id, processed_at, type }Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thinking""agent.thinking"
-
-
BetaManagedAgentsAgentMCPToolUseEvent object { id, input, mcp_server_name, 5 more }Event emitted when the agent invokes a tool provided by an MCP server.
-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
mcp_server_name: stringName of the MCP server providing the tool.
-
name: stringName of the MCP tool being used.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.mcp_tool_use""agent.mcp_tool_use"
-
evaluated_permission: optional "allow" or "ask" or "deny"AgentEvaluatedPermission enum
-
"allow" -
"ask" -
"deny"
-
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.tool_confirmationevent to route the approval back.
-
-
BetaManagedAgentsAgentMCPToolResultEvent object { id, mcp_tool_use_id, processed_at, 3 more }Event representing the result of an MCP tool execution.
-
id: stringUnique identifier for this event.
-
mcp_tool_use_id: stringThe id of the
agent.mcp_tool_useevent this result corresponds to. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.mcp_tool_result""agent.mcp_tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
-
BetaManagedAgentsAgentToolUseEvent object { id, input, name, 4 more }Event emitted when the agent invokes a built-in agent tool.
-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
name: stringName of the agent tool being used.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.tool_use""agent.tool_use"
-
evaluated_permission: optional "allow" or "ask" or "deny"AgentEvaluatedPermission enum
-
"allow" -
"ask" -
"deny"
-
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.tool_confirmationevent to route the approval back.
-
-
BetaManagedAgentsAgentToolResultEvent object { id, processed_at, tool_use_id, 3 more }Event representing the result of an agent tool execution.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
tool_use_id: stringThe id of the
agent.tool_useevent this result corresponds to. -
type: "agent.tool_result""agent.tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
-
BetaManagedAgentsAgentThreadMessageReceivedEvent object { id, content, from_session_thread_id, 3 more }Delivery event written to the target thread's input stream when an agent-to-agent message arrives.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockMessage content blocks.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
-
from_session_thread_id: stringPublic
sthr_ID of the thread that sent the message. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thread_message_received""agent.thread_message_received"
-
from_agent_name: optional stringName of the callable agent this message came from. Absent when received from the primary agent.
-
-
BetaManagedAgentsAgentThreadMessageSentEvent object { id, content, processed_at, 3 more }Observability event emitted to the sender's output stream when an agent-to-agent message is sent.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockMessage content blocks.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
-
processed_at: stringA timestamp in RFC 3339 format
-
to_session_thread_id: stringPublic
sthr_ID of the thread the message was sent to. -
type: "agent.thread_message_sent""agent.thread_message_sent"
-
to_agent_name: optional stringName of the callable agent this message was sent to. Absent when sent to the primary agent.
-
-
BetaManagedAgentsAgentThreadContextCompactedEvent object { id, processed_at, type }Indicates that context compaction (summarization) occurred during the session.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thread_context_compacted""agent.thread_context_compacted"
-
-
BetaManagedAgentsSessionErrorEvent object { id, error, processed_at, type }An error event indicating a problem occurred during session execution.
-
id: stringUnique identifier for this event.
-
error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 moreAn unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.-
BetaManagedAgentsUnknownError object { message, retry_status, type }An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
type: "retrying""retrying"
-
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
type: "exhausted""exhausted"
-
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.-
type: "terminal""terminal"
-
-
-
type: "unknown_error""unknown_error"
-
-
BetaManagedAgentsModelOverloadedError object { message, retry_status, type }The model is currently overloaded. Emitted after automatic retries are exhausted.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_overloaded_error""model_overloaded_error"
-
-
BetaManagedAgentsModelRateLimitedError object { message, retry_status, type }The model request was rate-limited.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_rate_limited_error""model_rate_limited_error"
-
-
BetaManagedAgentsModelRequestFailedError object { message, retry_status, type }A model request failed for a reason other than overload or rate-limiting.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_request_failed_error""model_request_failed_error"
-
-
BetaManagedAgentsMCPConnectionFailedError object { mcp_server_name, message, retry_status, type }Failed to connect to an MCP server.
-
mcp_server_name: stringName of the MCP server that failed to connect.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "mcp_connection_failed_error""mcp_connection_failed_error"
-
-
BetaManagedAgentsMCPAuthenticationFailedError object { mcp_server_name, message, retry_status, type }Authentication to an MCP server failed.
-
mcp_server_name: stringName of the MCP server that failed authentication.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "mcp_authentication_failed_error""mcp_authentication_failed_error"
-
-
BetaManagedAgentsBillingError object { message, retry_status, type }The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "billing_error""billing_error"
-
-
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.error""session.error"
-
-
BetaManagedAgentsSessionStatusRescheduledEvent object { id, processed_at, type }Indicates the session is recovering from an error state and is rescheduled for execution.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_rescheduled""session.status_rescheduled"
-
-
BetaManagedAgentsSessionStatusRunningEvent object { id, processed_at, type }Indicates the session is actively running and the agent is working.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_running""session.status_running"
-
-
BetaManagedAgentsSessionStatusIdleEvent object { id, processed_at, stop_reason, type }Indicates the agent has paused and is awaiting user input.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhaustedThe agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionEndTurn object { type }The agent completed its turn naturally and is ready for the next user message.
-
type: "end_turn""end_turn"
-
-
BetaManagedAgentsSessionRequiresAction object { event_ids, type }The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
event_ids: array of stringThe ids of events the agent is blocked on. Resolving fewer than all re-emits
session.status_idlewith the remainder. -
type: "requires_action""requires_action"
-
-
BetaManagedAgentsSessionRetriesExhausted object { type }The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').-
type: "retries_exhausted""retries_exhausted"
-
-
-
type: "session.status_idle""session.status_idle"
-
-
BetaManagedAgentsSessionStatusTerminatedEvent object { id, processed_at, type }Indicates the session has terminated, either due to an error or completion.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_terminated""session.status_terminated"
-
-
BetaManagedAgentsSessionThreadCreatedEvent object { id, agent_name, processed_at, 2 more }Emitted when a subagent is spawned as a new thread. Written to the parent thread's output stream so clients observing the session see child creation.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the callable agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic
sthr_ID of the newly created thread. -
type: "session.thread_created""session.thread_created"
-
-
BetaManagedAgentsSpanOutcomeEvaluationStartEvent object { id, iteration, outcome_id, 2 more }Emitted when an outcome evaluation cycle begins.
-
id: stringUnique identifier for this event.
-
iteration: number0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.
-
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.outcome_evaluation_start""span.outcome_evaluation_start"
-
-
BetaManagedAgentsSpanOutcomeEvaluationEndEvent object { id, explanation, iteration, 6 more }Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of
needs_revisionmeans another evaluation cycle follows;satisfied,max_iterations_reached,failed, orinterruptedare terminal — no further evaluation cycles follow.-
id: stringUnique identifier for this event.
-
explanation: stringHuman-readable explanation of the verdict. For
needs_revision, describes which criteria failed and why. -
iteration: number0-indexed revision cycle, matching the corresponding
span.outcome_evaluation_start. -
outcome_evaluation_start_id: stringThe id of the corresponding
span.outcome_evaluation_startevent. -
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
result: stringEvaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.
-
type: "span.outcome_evaluation_end""span.outcome_evaluation_end"
-
usage: BetaManagedAgentsSpanModelUsageToken usage for a single model request.
-
cache_creation_input_tokens: numberTokens used to create prompt cache in this request.
-
cache_read_input_tokens: numberTokens read from prompt cache in this request.
-
input_tokens: numberInput tokens consumed by this request.
-
output_tokens: numberOutput tokens generated by this request.
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
-
BetaManagedAgentsSpanModelRequestStartEvent object { id, processed_at, type }Emitted when a model request is initiated by the agent.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.model_request_start""span.model_request_start"
-
-
BetaManagedAgentsSpanModelRequestEndEvent object { id, is_error, model_request_start_id, 3 more }Emitted when a model request completes.
-
id: stringUnique identifier for this event.
-
is_error: booleanWhether the model request resulted in an error.
-
model_request_start_id: stringThe id of the corresponding
span.model_request_startevent. -
model_usage: BetaManagedAgentsSpanModelUsageToken usage for a single model request.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.model_request_end""span.model_request_end"
-
-
BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent object { id, iteration, outcome_id, 2 more }Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding
span.outcome_evaluation_startandspan.outcome_evaluation_endevents.-
id: stringUnique identifier for this event.
-
iteration: number0-indexed revision cycle, matching the corresponding
span.outcome_evaluation_start. -
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.outcome_evaluation_ongoing""span.outcome_evaluation_ongoing"
-
-
BetaManagedAgentsUserDefineOutcomeEvent object { id, description, max_iterations, 4 more }Echo of a
user.define_outcomeinput event. Carries the server-generatedoutcome_idthat subsequentspan.outcome_evaluation_*events reference.-
id: stringUnique identifier for this event.
-
description: stringWhat the agent should produce. Copied from the input event.
-
max_iterations: numberEvaluate-then-revise cycles before giving up. Default 3, max 20.
-
outcome_id: stringServer-generated
outc_ID for this outcome. Referenced byspan.outcome_evaluation_*events and the session'soutcome_evaluationslist. -
processed_at: stringA timestamp in RFC 3339 format
-
rubric: BetaManagedAgentsFileRubric or BetaManagedAgentsTextRubricRubric for grading the quality of an outcome.
-
BetaManagedAgentsFileRubric object { file_id, type }Rubric referenced by a file uploaded via the Files API.
-
file_id: stringID of the rubric file.
-
type: "file""file"
-
-
BetaManagedAgentsTextRubric object { content, type }Rubric content provided inline as text.
-
content: stringRubric content. Plain text or markdown — the grader treats it as freeform text.
-
type: "text""text"
-
-
-
type: "user.define_outcome""user.define_outcome"
-
-
BetaManagedAgentsSessionDeletedEvent object { id, processed_at, type }Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.deleted""session.deleted"
-
-
BetaManagedAgentsSessionThreadStatusRunningEvent object { id, agent_name, processed_at, 2 more }A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that started running.
-
type: "session.thread_status_running""session.thread_status_running"
-
-
BetaManagedAgentsSessionThreadStatusIdleEvent object { id, agent_name, processed_at, 3 more }A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that went idle.
-
stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhaustedThe agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionEndTurn object { type }The agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionRequiresAction object { event_ids, type }The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
BetaManagedAgentsSessionRetriesExhausted object { type }The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').
-
-
type: "session.thread_status_idle""session.thread_status_idle"
-
-
BetaManagedAgentsSessionThreadStatusTerminatedEvent object { id, agent_name, processed_at, 2 more }A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that terminated.
-
type: "session.thread_status_terminated""session.thread_status_terminated"
-
-
BetaManagedAgentsUserToolResultEvent object { id, tool_use_id, type, 4 more }Event sent by the client providing the result of an agent-toolset tool execution. Only valid on
self_hostedenvironments, where sandbox-routed tools are executed by the client rather than the server.-
id: stringUnique identifier for this event.
-
tool_use_id: stringThe id of the
agent.tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.tool_result""user.tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringRoutes this result to a subagent thread. Copy from the
agent.tool_useevent'ssession_thread_id.
-
-
BetaManagedAgentsSessionThreadStatusRescheduledEvent object { id, agent_name, processed_at, 2 more }A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that is retrying.
-
type: "session.thread_status_rescheduled""session.thread_status_rescheduled"
-
-
BetaManagedAgentsSessionUpdatedEvent object { id, processed_at, type, 3 more }Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.updated""session.updated"
-
agent: optional BetaManagedAgentsSessionAgentResolved
agentdefinition for asession. Snapshot of theagentatsessioncreation time.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url""url"
-
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
id: BetaManagedAgentsModelThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7" or "claude-opus-4-6" or "claude-sonnet-4-6" or 6 moreThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7"Frontier intelligence for long-running agents and coding
-
"claude-opus-4-6"Most intelligent model for building agents and coding
-
"claude-sonnet-4-6"Best combination of speed and intelligence
-
"claude-haiku-4-5"Fastest model with near-frontier intelligence
-
"claude-haiku-4-5-20251001"Fastest model with near-frontier intelligence
-
"claude-opus-4-5"Premium model combining maximum intelligence with practical performance
-
"claude-opus-4-5-20251101"Premium model combining maximum intelligence with practical performance
-
"claude-sonnet-4-5"High-performance model for agents and coding
-
"claude-sonnet-4-5-20250929"High-performance model for agents and coding
-
-
string
-
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
multiagent: BetaManagedAgentsSessionMultiagentCoordinatorResolved coordinator topology with full agent definitions for each roster member.
-
agents: array of BetaManagedAgentsSessionThreadAgentFull
agentdefinitions the coordinator may spawn as session threads.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url" -
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
skill_id: string -
type: "anthropic""anthropic"
-
version: string
-
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
skill_id: string -
type: "custom""custom"
-
version: string
-
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type }-
configs: array of BetaManagedAgentsAgentToolConfig-
enabled: boolean -
name: "bash" or "edit" or "read" or 5 moreBuilt-in agent tool identifier.
-
"bash" -
"edit" -
"read" -
"write" -
"glob" -
"grep" -
"web_fetch" -
"web_search"
-
-
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
type: "always_allow""always_allow"
-
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
type: "always_ask""always_ask"
-
-
-
-
default_config: BetaManagedAgentsAgentToolsetDefaultConfigResolved default configuration for agent tools.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
type: "agent_toolset_20260401""agent_toolset_20260401"
-
-
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type }-
configs: array of BetaManagedAgentsMCPToolConfig-
enabled: boolean -
name: string -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
default_config: BetaManagedAgentsMCPToolsetDefaultConfigResolved default configuration for all tools from an MCP server.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
mcp_server_name: string -
type: "mcp_toolset""mcp_toolset"
-
-
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
description: string -
input_schema: BetaManagedAgentsCustomToolInputSchemaJSON Schema for custom tool input parameters.
-
properties: optional map[unknown]JSON Schema properties defining the tool's input parameters.
-
required: optional array of stringList of required property names.
-
type: optional "object"Must be 'object' for tool input schemas.
"object"
-
-
name: string -
type: "custom""custom"
-
-
-
type: "agent""agent"
-
version: number
-
-
type: "coordinator""coordinator"
-
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type } -
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type } -
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
-
type: "agent""agent"
-
version: number
-
-
metadata: optional map[string]The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.
-
title: optional stringThe session's new title. Present only when the update changed it.
-
-
Events
List Session Thread Events
get /v1/sessions/{session_id}/threads/{thread_id}/events
List Session Thread Events
Path Parameters
-
session_id: string -
thread_id: string
Query Parameters
-
limit: optional numberQuery parameter for limit
-
page: optional stringQuery parameter for page
Header Parameters
-
"anthropic-beta": optional array of AnthropicBetaOptional header to specify the beta version(s) you want to use.
-
string -
"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 22 more-
"message-batches-2024-09-24" -
"prompt-caching-2024-07-31" -
"computer-use-2024-10-22" -
"computer-use-2025-01-24" -
"pdfs-2024-09-25" -
"token-counting-2024-11-01" -
"token-efficient-tools-2025-02-19" -
"output-128k-2025-02-19" -
"files-api-2025-04-14" -
"mcp-client-2025-04-04" -
"mcp-client-2025-11-20" -
"dev-full-thinking-2025-05-14" -
"interleaved-thinking-2025-05-14" -
"code-execution-2025-05-22" -
"extended-cache-ttl-2025-04-11" -
"context-1m-2025-08-07" -
"context-management-2025-06-27" -
"model-context-window-exceeded-2025-08-26" -
"skills-2025-10-02" -
"fast-mode-2026-02-01" -
"output-300k-2026-03-24" -
"user-profiles-2026-03-24" -
"advisor-tool-2026-03-01" -
"managed-agents-2026-04-01" -
"cache-diagnosis-2026-04-07"
-
-
Returns
-
data: optional array of BetaManagedAgentsSessionEventEvents for the thread, ordered by
created_at.-
BetaManagedAgentsUserMessageEvent object { id, content, type, processed_at }A user message event in the session conversation.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockArray of content blocks comprising the user message.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
text: stringThe text content.
-
type: "text""text"
-
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSourceUnion type for image source variants.
-
BetaManagedAgentsBase64ImageSource object { data, media_type, type }Base64-encoded image data.
-
data: stringBase64-encoded image data.
-
media_type: stringMIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
-
type: "base64""base64"
-
-
BetaManagedAgentsURLImageSource object { type, url }Image referenced by URL.
-
type: "url""url"
-
url: stringURL of the image to fetch.
-
-
BetaManagedAgentsFileImageSource object { file_id, type }Image referenced by file ID.
-
file_id: stringID of a previously uploaded file.
-
type: "file""file"
-
-
-
type: "image""image"
-
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSourceUnion type for document source variants.
-
BetaManagedAgentsBase64DocumentSource object { data, media_type, type }Base64-encoded document data.
-
data: stringBase64-encoded document data.
-
media_type: stringMIME type of the document (e.g., "application/pdf").
-
type: "base64""base64"
-
-
BetaManagedAgentsPlainTextDocumentSource object { data, media_type, type }Plain text document content.
-
data: stringThe plain text content.
-
media_type: "text/plain"MIME type of the text content. Must be "text/plain".
"text/plain"
-
type: "text""text"
-
-
BetaManagedAgentsURLDocumentSource object { type, url }Document referenced by URL.
-
type: "url""url"
-
url: stringURL of the document to fetch.
-
-
BetaManagedAgentsFileDocumentSource object { file_id, type }Document referenced by file ID.
-
file_id: stringID of a previously uploaded file.
-
type: "file""file"
-
-
-
type: "document""document"
-
context: optional stringAdditional context about the document for the model.
-
title: optional stringThe title of the document.
-
-
-
type: "user.message""user.message"
-
processed_at: optional stringA timestamp in RFC 3339 format
-
-
BetaManagedAgentsUserInterruptEvent object { id, type, processed_at, session_thread_id }An interrupt event that pauses agent execution and returns control to the user.
-
id: stringUnique identifier for this event.
-
type: "user.interrupt""user.interrupt"
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringIf absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.
-
-
BetaManagedAgentsUserToolConfirmationEvent object { id, result, tool_use_id, 4 more }A tool confirmation event that approves or denies a pending tool execution.
-
id: stringUnique identifier for this event.
-
result: "allow" or "deny"UserToolConfirmationResult enum
-
"allow" -
"deny"
-
-
tool_use_id: stringThe id of the
agent.tool_useoragent.mcp_tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.tool_confirmation""user.tool_confirmation"
-
deny_message: optional stringOptional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringWhen set, the confirmation routes to this subagent's thread rather than the primary. Echo this from the
session_thread_idon theagent.tool_useoragent.mcp_tool_useevent that prompted the approval.
-
-
BetaManagedAgentsUserCustomToolResultEvent object { id, custom_tool_use_id, type, 4 more }Event sent by the client providing the result of a custom tool execution.
-
id: stringUnique identifier for this event.
-
custom_tool_use_id: stringThe id of the
agent.custom_tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.custom_tool_result""user.custom_tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
citations: BetaManagedAgentsSearchResultCitationsCitation settings for a search result.
-
enabled: booleanWhether citations are enabled for this search result.
-
-
content: array of BetaManagedAgentsSearchResultContentArray of text content blocks from the search result.
-
text: stringThe text content.
-
type: "text""text"
-
-
source: stringThe URL source of the search result.
-
title: stringThe title of the search result.
-
type: "search_result""search_result"
-
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringRoutes this result to a subagent thread. Copy from the
agent.custom_tool_useevent'ssession_thread_id.
-
-
BetaManagedAgentsAgentCustomToolUseEvent object { id, input, name, 3 more }Event emitted when the agent calls a custom tool. The session goes idle until the client sends a
user.custom_tool_resultevent with the result.-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
name: stringName of the custom tool being called.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.custom_tool_use""agent.custom_tool_use"
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.custom_tool_resultevent to route the result back.
-
-
BetaManagedAgentsAgentMessageEvent object { id, content, processed_at, type }An agent response event in the session conversation.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlockArray of text blocks comprising the agent response.
-
text: stringThe text content.
-
type: "text"
-
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.message""agent.message"
-
-
BetaManagedAgentsAgentThinkingEvent object { id, processed_at, type }Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thinking""agent.thinking"
-
-
BetaManagedAgentsAgentMCPToolUseEvent object { id, input, mcp_server_name, 5 more }Event emitted when the agent invokes a tool provided by an MCP server.
-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
mcp_server_name: stringName of the MCP server providing the tool.
-
name: stringName of the MCP tool being used.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.mcp_tool_use""agent.mcp_tool_use"
-
evaluated_permission: optional "allow" or "ask" or "deny"AgentEvaluatedPermission enum
-
"allow" -
"ask" -
"deny"
-
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.tool_confirmationevent to route the approval back.
-
-
BetaManagedAgentsAgentMCPToolResultEvent object { id, mcp_tool_use_id, processed_at, 3 more }Event representing the result of an MCP tool execution.
-
id: stringUnique identifier for this event.
-
mcp_tool_use_id: stringThe id of the
agent.mcp_tool_useevent this result corresponds to. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.mcp_tool_result""agent.mcp_tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
-
BetaManagedAgentsAgentToolUseEvent object { id, input, name, 4 more }Event emitted when the agent invokes a built-in agent tool.
-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
name: stringName of the agent tool being used.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.tool_use""agent.tool_use"
-
evaluated_permission: optional "allow" or "ask" or "deny"AgentEvaluatedPermission enum
-
"allow" -
"ask" -
"deny"
-
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.tool_confirmationevent to route the approval back.
-
-
BetaManagedAgentsAgentToolResultEvent object { id, processed_at, tool_use_id, 3 more }Event representing the result of an agent tool execution.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
tool_use_id: stringThe id of the
agent.tool_useevent this result corresponds to. -
type: "agent.tool_result""agent.tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
-
BetaManagedAgentsAgentThreadMessageReceivedEvent object { id, content, from_session_thread_id, 3 more }Delivery event written to the target thread's input stream when an agent-to-agent message arrives.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockMessage content blocks.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
-
from_session_thread_id: stringPublic
sthr_ID of the thread that sent the message. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thread_message_received""agent.thread_message_received"
-
from_agent_name: optional stringName of the callable agent this message came from. Absent when received from the primary agent.
-
-
BetaManagedAgentsAgentThreadMessageSentEvent object { id, content, processed_at, 3 more }Observability event emitted to the sender's output stream when an agent-to-agent message is sent.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockMessage content blocks.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
-
processed_at: stringA timestamp in RFC 3339 format
-
to_session_thread_id: stringPublic
sthr_ID of the thread the message was sent to. -
type: "agent.thread_message_sent""agent.thread_message_sent"
-
to_agent_name: optional stringName of the callable agent this message was sent to. Absent when sent to the primary agent.
-
-
BetaManagedAgentsAgentThreadContextCompactedEvent object { id, processed_at, type }Indicates that context compaction (summarization) occurred during the session.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thread_context_compacted""agent.thread_context_compacted"
-
-
BetaManagedAgentsSessionErrorEvent object { id, error, processed_at, type }An error event indicating a problem occurred during session execution.
-
id: stringUnique identifier for this event.
-
error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 moreAn unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.-
BetaManagedAgentsUnknownError object { message, retry_status, type }An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
type: "retrying""retrying"
-
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
type: "exhausted""exhausted"
-
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.-
type: "terminal""terminal"
-
-
-
type: "unknown_error""unknown_error"
-
-
BetaManagedAgentsModelOverloadedError object { message, retry_status, type }The model is currently overloaded. Emitted after automatic retries are exhausted.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_overloaded_error""model_overloaded_error"
-
-
BetaManagedAgentsModelRateLimitedError object { message, retry_status, type }The model request was rate-limited.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_rate_limited_error""model_rate_limited_error"
-
-
BetaManagedAgentsModelRequestFailedError object { message, retry_status, type }A model request failed for a reason other than overload or rate-limiting.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_request_failed_error""model_request_failed_error"
-
-
BetaManagedAgentsMCPConnectionFailedError object { mcp_server_name, message, retry_status, type }Failed to connect to an MCP server.
-
mcp_server_name: stringName of the MCP server that failed to connect.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "mcp_connection_failed_error""mcp_connection_failed_error"
-
-
BetaManagedAgentsMCPAuthenticationFailedError object { mcp_server_name, message, retry_status, type }Authentication to an MCP server failed.
-
mcp_server_name: stringName of the MCP server that failed authentication.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "mcp_authentication_failed_error""mcp_authentication_failed_error"
-
-
BetaManagedAgentsBillingError object { message, retry_status, type }The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "billing_error""billing_error"
-
-
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.error""session.error"
-
-
BetaManagedAgentsSessionStatusRescheduledEvent object { id, processed_at, type }Indicates the session is recovering from an error state and is rescheduled for execution.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_rescheduled""session.status_rescheduled"
-
-
BetaManagedAgentsSessionStatusRunningEvent object { id, processed_at, type }Indicates the session is actively running and the agent is working.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_running""session.status_running"
-
-
BetaManagedAgentsSessionStatusIdleEvent object { id, processed_at, stop_reason, type }Indicates the agent has paused and is awaiting user input.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhaustedThe agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionEndTurn object { type }The agent completed its turn naturally and is ready for the next user message.
-
type: "end_turn""end_turn"
-
-
BetaManagedAgentsSessionRequiresAction object { event_ids, type }The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
event_ids: array of stringThe ids of events the agent is blocked on. Resolving fewer than all re-emits
session.status_idlewith the remainder. -
type: "requires_action""requires_action"
-
-
BetaManagedAgentsSessionRetriesExhausted object { type }The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').-
type: "retries_exhausted""retries_exhausted"
-
-
-
type: "session.status_idle""session.status_idle"
-
-
BetaManagedAgentsSessionStatusTerminatedEvent object { id, processed_at, type }Indicates the session has terminated, either due to an error or completion.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_terminated""session.status_terminated"
-
-
BetaManagedAgentsSessionThreadCreatedEvent object { id, agent_name, processed_at, 2 more }Emitted when a subagent is spawned as a new thread. Written to the parent thread's output stream so clients observing the session see child creation.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the callable agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic
sthr_ID of the newly created thread. -
type: "session.thread_created""session.thread_created"
-
-
BetaManagedAgentsSpanOutcomeEvaluationStartEvent object { id, iteration, outcome_id, 2 more }Emitted when an outcome evaluation cycle begins.
-
id: stringUnique identifier for this event.
-
iteration: number0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.
-
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.outcome_evaluation_start""span.outcome_evaluation_start"
-
-
BetaManagedAgentsSpanOutcomeEvaluationEndEvent object { id, explanation, iteration, 6 more }Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of
needs_revisionmeans another evaluation cycle follows;satisfied,max_iterations_reached,failed, orinterruptedare terminal — no further evaluation cycles follow.-
id: stringUnique identifier for this event.
-
explanation: stringHuman-readable explanation of the verdict. For
needs_revision, describes which criteria failed and why. -
iteration: number0-indexed revision cycle, matching the corresponding
span.outcome_evaluation_start. -
outcome_evaluation_start_id: stringThe id of the corresponding
span.outcome_evaluation_startevent. -
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
result: stringEvaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.
-
type: "span.outcome_evaluation_end""span.outcome_evaluation_end"
-
usage: BetaManagedAgentsSpanModelUsageToken usage for a single model request.
-
cache_creation_input_tokens: numberTokens used to create prompt cache in this request.
-
cache_read_input_tokens: numberTokens read from prompt cache in this request.
-
input_tokens: numberInput tokens consumed by this request.
-
output_tokens: numberOutput tokens generated by this request.
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
-
BetaManagedAgentsSpanModelRequestStartEvent object { id, processed_at, type }Emitted when a model request is initiated by the agent.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.model_request_start""span.model_request_start"
-
-
BetaManagedAgentsSpanModelRequestEndEvent object { id, is_error, model_request_start_id, 3 more }Emitted when a model request completes.
-
id: stringUnique identifier for this event.
-
is_error: booleanWhether the model request resulted in an error.
-
model_request_start_id: stringThe id of the corresponding
span.model_request_startevent. -
model_usage: BetaManagedAgentsSpanModelUsageToken usage for a single model request.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.model_request_end""span.model_request_end"
-
-
BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent object { id, iteration, outcome_id, 2 more }Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding
span.outcome_evaluation_startandspan.outcome_evaluation_endevents.-
id: stringUnique identifier for this event.
-
iteration: number0-indexed revision cycle, matching the corresponding
span.outcome_evaluation_start. -
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.outcome_evaluation_ongoing""span.outcome_evaluation_ongoing"
-
-
BetaManagedAgentsUserDefineOutcomeEvent object { id, description, max_iterations, 4 more }Echo of a
user.define_outcomeinput event. Carries the server-generatedoutcome_idthat subsequentspan.outcome_evaluation_*events reference.-
id: stringUnique identifier for this event.
-
description: stringWhat the agent should produce. Copied from the input event.
-
max_iterations: numberEvaluate-then-revise cycles before giving up. Default 3, max 20.
-
outcome_id: stringServer-generated
outc_ID for this outcome. Referenced byspan.outcome_evaluation_*events and the session'soutcome_evaluationslist. -
processed_at: stringA timestamp in RFC 3339 format
-
rubric: BetaManagedAgentsFileRubric or BetaManagedAgentsTextRubricRubric for grading the quality of an outcome.
-
BetaManagedAgentsFileRubric object { file_id, type }Rubric referenced by a file uploaded via the Files API.
-
file_id: stringID of the rubric file.
-
type: "file""file"
-
-
BetaManagedAgentsTextRubric object { content, type }Rubric content provided inline as text.
-
content: stringRubric content. Plain text or markdown — the grader treats it as freeform text.
-
type: "text""text"
-
-
-
type: "user.define_outcome""user.define_outcome"
-
-
BetaManagedAgentsSessionDeletedEvent object { id, processed_at, type }Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.deleted""session.deleted"
-
-
BetaManagedAgentsSessionThreadStatusRunningEvent object { id, agent_name, processed_at, 2 more }A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that started running.
-
type: "session.thread_status_running""session.thread_status_running"
-
-
BetaManagedAgentsSessionThreadStatusIdleEvent object { id, agent_name, processed_at, 3 more }A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that went idle.
-
stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhaustedThe agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionEndTurn object { type }The agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionRequiresAction object { event_ids, type }The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
BetaManagedAgentsSessionRetriesExhausted object { type }The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').
-
-
type: "session.thread_status_idle""session.thread_status_idle"
-
-
BetaManagedAgentsSessionThreadStatusTerminatedEvent object { id, agent_name, processed_at, 2 more }A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that terminated.
-
type: "session.thread_status_terminated""session.thread_status_terminated"
-
-
BetaManagedAgentsUserToolResultEvent object { id, tool_use_id, type, 4 more }Event sent by the client providing the result of an agent-toolset tool execution. Only valid on
self_hostedenvironments, where sandbox-routed tools are executed by the client rather than the server.-
id: stringUnique identifier for this event.
-
tool_use_id: stringThe id of the
agent.tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.tool_result""user.tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringRoutes this result to a subagent thread. Copy from the
agent.tool_useevent'ssession_thread_id.
-
-
BetaManagedAgentsSessionThreadStatusRescheduledEvent object { id, agent_name, processed_at, 2 more }A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that is retrying.
-
type: "session.thread_status_rescheduled""session.thread_status_rescheduled"
-
-
BetaManagedAgentsSessionUpdatedEvent object { id, processed_at, type, 3 more }Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.updated""session.updated"
-
agent: optional BetaManagedAgentsSessionAgentResolved
agentdefinition for asession. Snapshot of theagentatsessioncreation time.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url""url"
-
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
id: BetaManagedAgentsModelThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7" or "claude-opus-4-6" or "claude-sonnet-4-6" or 6 moreThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7"Frontier intelligence for long-running agents and coding
-
"claude-opus-4-6"Most intelligent model for building agents and coding
-
"claude-sonnet-4-6"Best combination of speed and intelligence
-
"claude-haiku-4-5"Fastest model with near-frontier intelligence
-
"claude-haiku-4-5-20251001"Fastest model with near-frontier intelligence
-
"claude-opus-4-5"Premium model combining maximum intelligence with practical performance
-
"claude-opus-4-5-20251101"Premium model combining maximum intelligence with practical performance
-
"claude-sonnet-4-5"High-performance model for agents and coding
-
"claude-sonnet-4-5-20250929"High-performance model for agents and coding
-
-
string
-
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
multiagent: BetaManagedAgentsSessionMultiagentCoordinatorResolved coordinator topology with full agent definitions for each roster member.
-
agents: array of BetaManagedAgentsSessionThreadAgentFull
agentdefinitions the coordinator may spawn as session threads.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url" -
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
skill_id: string -
type: "anthropic""anthropic"
-
version: string
-
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
skill_id: string -
type: "custom""custom"
-
version: string
-
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type }-
configs: array of BetaManagedAgentsAgentToolConfig-
enabled: boolean -
name: "bash" or "edit" or "read" or 5 moreBuilt-in agent tool identifier.
-
"bash" -
"edit" -
"read" -
"write" -
"glob" -
"grep" -
"web_fetch" -
"web_search"
-
-
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
type: "always_allow""always_allow"
-
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
type: "always_ask""always_ask"
-
-
-
-
default_config: BetaManagedAgentsAgentToolsetDefaultConfigResolved default configuration for agent tools.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
type: "agent_toolset_20260401""agent_toolset_20260401"
-
-
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type }-
configs: array of BetaManagedAgentsMCPToolConfig-
enabled: boolean -
name: string -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
default_config: BetaManagedAgentsMCPToolsetDefaultConfigResolved default configuration for all tools from an MCP server.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
mcp_server_name: string -
type: "mcp_toolset""mcp_toolset"
-
-
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
description: string -
input_schema: BetaManagedAgentsCustomToolInputSchemaJSON Schema for custom tool input parameters.
-
properties: optional map[unknown]JSON Schema properties defining the tool's input parameters.
-
required: optional array of stringList of required property names.
-
type: optional "object"Must be 'object' for tool input schemas.
"object"
-
-
name: string -
type: "custom""custom"
-
-
-
type: "agent""agent"
-
version: number
-
-
type: "coordinator""coordinator"
-
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type } -
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type } -
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
-
type: "agent""agent"
-
version: number
-
-
metadata: optional map[string]The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.
-
title: optional stringThe session's new title. Present only when the update changed it.
-
-
-
next_page: optional stringOpaque cursor for the next page. Null when no more results.
Example
curl https://api.anthropic.com/v1/sessions/$SESSION_ID/threads/$THREAD_ID/events \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: managed-agents-2026-04-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
Response
{
"data": [
{
"id": "sevt_011CZkZGOp0iBcp4kaQSihUmy",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}
],
"next_page": "next_page"
}
Stream Session Thread Events
get /v1/sessions/{session_id}/threads/{thread_id}/stream
Stream Session Thread Events
Path Parameters
-
session_id: string -
thread_id: string
Header Parameters
-
"anthropic-beta": optional array of AnthropicBetaOptional header to specify the beta version(s) you want to use.
-
string -
"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 22 more-
"message-batches-2024-09-24" -
"prompt-caching-2024-07-31" -
"computer-use-2024-10-22" -
"computer-use-2025-01-24" -
"pdfs-2024-09-25" -
"token-counting-2024-11-01" -
"token-efficient-tools-2025-02-19" -
"output-128k-2025-02-19" -
"files-api-2025-04-14" -
"mcp-client-2025-04-04" -
"mcp-client-2025-11-20" -
"dev-full-thinking-2025-05-14" -
"interleaved-thinking-2025-05-14" -
"code-execution-2025-05-22" -
"extended-cache-ttl-2025-04-11" -
"context-1m-2025-08-07" -
"context-management-2025-06-27" -
"model-context-window-exceeded-2025-08-26" -
"skills-2025-10-02" -
"fast-mode-2026-02-01" -
"output-300k-2026-03-24" -
"user-profiles-2026-03-24" -
"advisor-tool-2026-03-01" -
"managed-agents-2026-04-01" -
"cache-diagnosis-2026-04-07"
-
-
Returns
-
BetaManagedAgentsStreamSessionThreadEvents = BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 30 moreServer-sent event in a single thread's stream.
-
BetaManagedAgentsUserMessageEvent object { id, content, type, processed_at }A user message event in the session conversation.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockArray of content blocks comprising the user message.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
text: stringThe text content.
-
type: "text""text"
-
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSourceUnion type for image source variants.
-
BetaManagedAgentsBase64ImageSource object { data, media_type, type }Base64-encoded image data.
-
data: stringBase64-encoded image data.
-
media_type: stringMIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
-
type: "base64""base64"
-
-
BetaManagedAgentsURLImageSource object { type, url }Image referenced by URL.
-
type: "url""url"
-
url: stringURL of the image to fetch.
-
-
BetaManagedAgentsFileImageSource object { file_id, type }Image referenced by file ID.
-
file_id: stringID of a previously uploaded file.
-
type: "file""file"
-
-
-
type: "image""image"
-
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSourceUnion type for document source variants.
-
BetaManagedAgentsBase64DocumentSource object { data, media_type, type }Base64-encoded document data.
-
data: stringBase64-encoded document data.
-
media_type: stringMIME type of the document (e.g., "application/pdf").
-
type: "base64""base64"
-
-
BetaManagedAgentsPlainTextDocumentSource object { data, media_type, type }Plain text document content.
-
data: stringThe plain text content.
-
media_type: "text/plain"MIME type of the text content. Must be "text/plain".
"text/plain"
-
type: "text""text"
-
-
BetaManagedAgentsURLDocumentSource object { type, url }Document referenced by URL.
-
type: "url""url"
-
url: stringURL of the document to fetch.
-
-
BetaManagedAgentsFileDocumentSource object { file_id, type }Document referenced by file ID.
-
file_id: stringID of a previously uploaded file.
-
type: "file""file"
-
-
-
type: "document""document"
-
context: optional stringAdditional context about the document for the model.
-
title: optional stringThe title of the document.
-
-
-
type: "user.message""user.message"
-
processed_at: optional stringA timestamp in RFC 3339 format
-
-
BetaManagedAgentsUserInterruptEvent object { id, type, processed_at, session_thread_id }An interrupt event that pauses agent execution and returns control to the user.
-
id: stringUnique identifier for this event.
-
type: "user.interrupt""user.interrupt"
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringIf absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.
-
-
BetaManagedAgentsUserToolConfirmationEvent object { id, result, tool_use_id, 4 more }A tool confirmation event that approves or denies a pending tool execution.
-
id: stringUnique identifier for this event.
-
result: "allow" or "deny"UserToolConfirmationResult enum
-
"allow" -
"deny"
-
-
tool_use_id: stringThe id of the
agent.tool_useoragent.mcp_tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.tool_confirmation""user.tool_confirmation"
-
deny_message: optional stringOptional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringWhen set, the confirmation routes to this subagent's thread rather than the primary. Echo this from the
session_thread_idon theagent.tool_useoragent.mcp_tool_useevent that prompted the approval.
-
-
BetaManagedAgentsUserCustomToolResultEvent object { id, custom_tool_use_id, type, 4 more }Event sent by the client providing the result of a custom tool execution.
-
id: stringUnique identifier for this event.
-
custom_tool_use_id: stringThe id of the
agent.custom_tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.custom_tool_result""user.custom_tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
citations: BetaManagedAgentsSearchResultCitationsCitation settings for a search result.
-
enabled: booleanWhether citations are enabled for this search result.
-
-
content: array of BetaManagedAgentsSearchResultContentArray of text content blocks from the search result.
-
text: stringThe text content.
-
type: "text""text"
-
-
source: stringThe URL source of the search result.
-
title: stringThe title of the search result.
-
type: "search_result""search_result"
-
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringRoutes this result to a subagent thread. Copy from the
agent.custom_tool_useevent'ssession_thread_id.
-
-
BetaManagedAgentsAgentCustomToolUseEvent object { id, input, name, 3 more }Event emitted when the agent calls a custom tool. The session goes idle until the client sends a
user.custom_tool_resultevent with the result.-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
name: stringName of the custom tool being called.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.custom_tool_use""agent.custom_tool_use"
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.custom_tool_resultevent to route the result back.
-
-
BetaManagedAgentsAgentMessageEvent object { id, content, processed_at, type }An agent response event in the session conversation.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlockArray of text blocks comprising the agent response.
-
text: stringThe text content.
-
type: "text"
-
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.message""agent.message"
-
-
BetaManagedAgentsAgentThinkingEvent object { id, processed_at, type }Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thinking""agent.thinking"
-
-
BetaManagedAgentsAgentMCPToolUseEvent object { id, input, mcp_server_name, 5 more }Event emitted when the agent invokes a tool provided by an MCP server.
-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
mcp_server_name: stringName of the MCP server providing the tool.
-
name: stringName of the MCP tool being used.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.mcp_tool_use""agent.mcp_tool_use"
-
evaluated_permission: optional "allow" or "ask" or "deny"AgentEvaluatedPermission enum
-
"allow" -
"ask" -
"deny"
-
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.tool_confirmationevent to route the approval back.
-
-
BetaManagedAgentsAgentMCPToolResultEvent object { id, mcp_tool_use_id, processed_at, 3 more }Event representing the result of an MCP tool execution.
-
id: stringUnique identifier for this event.
-
mcp_tool_use_id: stringThe id of the
agent.mcp_tool_useevent this result corresponds to. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.mcp_tool_result""agent.mcp_tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
-
BetaManagedAgentsAgentToolUseEvent object { id, input, name, 4 more }Event emitted when the agent invokes a built-in agent tool.
-
id: stringUnique identifier for this event.
-
input: map[unknown]Input parameters for the tool call.
-
name: stringName of the agent tool being used.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.tool_use""agent.tool_use"
-
evaluated_permission: optional "allow" or "ask" or "deny"AgentEvaluatedPermission enum
-
"allow" -
"ask" -
"deny"
-
-
session_thread_id: optional stringWhen set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a
user.tool_confirmationevent to route the approval back.
-
-
BetaManagedAgentsAgentToolResultEvent object { id, processed_at, tool_use_id, 3 more }Event representing the result of an agent tool execution.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
tool_use_id: stringThe id of the
agent.tool_useevent this result corresponds to. -
type: "agent.tool_result""agent.tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
-
BetaManagedAgentsAgentThreadMessageReceivedEvent object { id, content, from_session_thread_id, 3 more }Delivery event written to the target thread's input stream when an agent-to-agent message arrives.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockMessage content blocks.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
-
from_session_thread_id: stringPublic
sthr_ID of the thread that sent the message. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thread_message_received""agent.thread_message_received"
-
from_agent_name: optional stringName of the callable agent this message came from. Absent when received from the primary agent.
-
-
BetaManagedAgentsAgentThreadMessageSentEvent object { id, content, processed_at, 3 more }Observability event emitted to the sender's output stream when an agent-to-agent message is sent.
-
id: stringUnique identifier for this event.
-
content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlockMessage content blocks.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
-
processed_at: stringA timestamp in RFC 3339 format
-
to_session_thread_id: stringPublic
sthr_ID of the thread the message was sent to. -
type: "agent.thread_message_sent""agent.thread_message_sent"
-
to_agent_name: optional stringName of the callable agent this message was sent to. Absent when sent to the primary agent.
-
-
BetaManagedAgentsAgentThreadContextCompactedEvent object { id, processed_at, type }Indicates that context compaction (summarization) occurred during the session.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "agent.thread_context_compacted""agent.thread_context_compacted"
-
-
BetaManagedAgentsSessionErrorEvent object { id, error, processed_at, type }An error event indicating a problem occurred during session execution.
-
id: stringUnique identifier for this event.
-
error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 moreAn unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.-
BetaManagedAgentsUnknownError object { message, retry_status, type }An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
type: "retrying""retrying"
-
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
type: "exhausted""exhausted"
-
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.-
type: "terminal""terminal"
-
-
-
type: "unknown_error""unknown_error"
-
-
BetaManagedAgentsModelOverloadedError object { message, retry_status, type }The model is currently overloaded. Emitted after automatic retries are exhausted.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_overloaded_error""model_overloaded_error"
-
-
BetaManagedAgentsModelRateLimitedError object { message, retry_status, type }The model request was rate-limited.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_rate_limited_error""model_rate_limited_error"
-
-
BetaManagedAgentsModelRequestFailedError object { message, retry_status, type }A model request failed for a reason other than overload or rate-limiting.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "model_request_failed_error""model_request_failed_error"
-
-
BetaManagedAgentsMCPConnectionFailedError object { mcp_server_name, message, retry_status, type }Failed to connect to an MCP server.
-
mcp_server_name: stringName of the MCP server that failed to connect.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "mcp_connection_failed_error""mcp_connection_failed_error"
-
-
BetaManagedAgentsMCPAuthenticationFailedError object { mcp_server_name, message, retry_status, type }Authentication to an MCP server failed.
-
mcp_server_name: stringName of the MCP server that failed authentication.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "mcp_authentication_failed_error""mcp_authentication_failed_error"
-
-
BetaManagedAgentsBillingError object { message, retry_status, type }The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
-
message: stringHuman-readable error description.
-
retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminalWhat the client should do next in response to this error.
-
BetaManagedAgentsRetryStatusRetrying object { type }The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
BetaManagedAgentsRetryStatusExhausted object { type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
BetaManagedAgentsRetryStatusTerminal object { type }The session encountered a terminal error and will transition to
terminatedstate.
-
-
type: "billing_error""billing_error"
-
-
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.error""session.error"
-
-
BetaManagedAgentsSessionStatusRescheduledEvent object { id, processed_at, type }Indicates the session is recovering from an error state and is rescheduled for execution.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_rescheduled""session.status_rescheduled"
-
-
BetaManagedAgentsSessionStatusRunningEvent object { id, processed_at, type }Indicates the session is actively running and the agent is working.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_running""session.status_running"
-
-
BetaManagedAgentsSessionStatusIdleEvent object { id, processed_at, stop_reason, type }Indicates the agent has paused and is awaiting user input.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhaustedThe agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionEndTurn object { type }The agent completed its turn naturally and is ready for the next user message.
-
type: "end_turn""end_turn"
-
-
BetaManagedAgentsSessionRequiresAction object { event_ids, type }The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
event_ids: array of stringThe ids of events the agent is blocked on. Resolving fewer than all re-emits
session.status_idlewith the remainder. -
type: "requires_action""requires_action"
-
-
BetaManagedAgentsSessionRetriesExhausted object { type }The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').-
type: "retries_exhausted""retries_exhausted"
-
-
-
type: "session.status_idle""session.status_idle"
-
-
BetaManagedAgentsSessionStatusTerminatedEvent object { id, processed_at, type }Indicates the session has terminated, either due to an error or completion.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.status_terminated""session.status_terminated"
-
-
BetaManagedAgentsSessionThreadCreatedEvent object { id, agent_name, processed_at, 2 more }Emitted when a subagent is spawned as a new thread. Written to the parent thread's output stream so clients observing the session see child creation.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the callable agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic
sthr_ID of the newly created thread. -
type: "session.thread_created""session.thread_created"
-
-
BetaManagedAgentsSpanOutcomeEvaluationStartEvent object { id, iteration, outcome_id, 2 more }Emitted when an outcome evaluation cycle begins.
-
id: stringUnique identifier for this event.
-
iteration: number0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.
-
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.outcome_evaluation_start""span.outcome_evaluation_start"
-
-
BetaManagedAgentsSpanOutcomeEvaluationEndEvent object { id, explanation, iteration, 6 more }Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of
needs_revisionmeans another evaluation cycle follows;satisfied,max_iterations_reached,failed, orinterruptedare terminal — no further evaluation cycles follow.-
id: stringUnique identifier for this event.
-
explanation: stringHuman-readable explanation of the verdict. For
needs_revision, describes which criteria failed and why. -
iteration: number0-indexed revision cycle, matching the corresponding
span.outcome_evaluation_start. -
outcome_evaluation_start_id: stringThe id of the corresponding
span.outcome_evaluation_startevent. -
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
result: stringEvaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.
-
type: "span.outcome_evaluation_end""span.outcome_evaluation_end"
-
usage: BetaManagedAgentsSpanModelUsageToken usage for a single model request.
-
cache_creation_input_tokens: numberTokens used to create prompt cache in this request.
-
cache_read_input_tokens: numberTokens read from prompt cache in this request.
-
input_tokens: numberInput tokens consumed by this request.
-
output_tokens: numberOutput tokens generated by this request.
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
-
BetaManagedAgentsSpanModelRequestStartEvent object { id, processed_at, type }Emitted when a model request is initiated by the agent.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.model_request_start""span.model_request_start"
-
-
BetaManagedAgentsSpanModelRequestEndEvent object { id, is_error, model_request_start_id, 3 more }Emitted when a model request completes.
-
id: stringUnique identifier for this event.
-
is_error: booleanWhether the model request resulted in an error.
-
model_request_start_id: stringThe id of the corresponding
span.model_request_startevent. -
model_usage: BetaManagedAgentsSpanModelUsageToken usage for a single model request.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.model_request_end""span.model_request_end"
-
-
BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent object { id, iteration, outcome_id, 2 more }Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding
span.outcome_evaluation_startandspan.outcome_evaluation_endevents.-
id: stringUnique identifier for this event.
-
iteration: number0-indexed revision cycle, matching the corresponding
span.outcome_evaluation_start. -
outcome_id: stringThe
outc_ID of the outcome being evaluated. -
processed_at: stringA timestamp in RFC 3339 format
-
type: "span.outcome_evaluation_ongoing""span.outcome_evaluation_ongoing"
-
-
BetaManagedAgentsUserDefineOutcomeEvent object { id, description, max_iterations, 4 more }Echo of a
user.define_outcomeinput event. Carries the server-generatedoutcome_idthat subsequentspan.outcome_evaluation_*events reference.-
id: stringUnique identifier for this event.
-
description: stringWhat the agent should produce. Copied from the input event.
-
max_iterations: numberEvaluate-then-revise cycles before giving up. Default 3, max 20.
-
outcome_id: stringServer-generated
outc_ID for this outcome. Referenced byspan.outcome_evaluation_*events and the session'soutcome_evaluationslist. -
processed_at: stringA timestamp in RFC 3339 format
-
rubric: BetaManagedAgentsFileRubric or BetaManagedAgentsTextRubricRubric for grading the quality of an outcome.
-
BetaManagedAgentsFileRubric object { file_id, type }Rubric referenced by a file uploaded via the Files API.
-
file_id: stringID of the rubric file.
-
type: "file""file"
-
-
BetaManagedAgentsTextRubric object { content, type }Rubric content provided inline as text.
-
content: stringRubric content. Plain text or markdown — the grader treats it as freeform text.
-
type: "text""text"
-
-
-
type: "user.define_outcome""user.define_outcome"
-
-
BetaManagedAgentsSessionDeletedEvent object { id, processed_at, type }Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.deleted""session.deleted"
-
-
BetaManagedAgentsSessionThreadStatusRunningEvent object { id, agent_name, processed_at, 2 more }A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that started running.
-
type: "session.thread_status_running""session.thread_status_running"
-
-
BetaManagedAgentsSessionThreadStatusIdleEvent object { id, agent_name, processed_at, 3 more }A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that went idle.
-
stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhaustedThe agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionEndTurn object { type }The agent completed its turn naturally and is ready for the next user message.
-
BetaManagedAgentsSessionRequiresAction object { event_ids, type }The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
BetaManagedAgentsSessionRetriesExhausted object { type }The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').
-
-
type: "session.thread_status_idle""session.thread_status_idle"
-
-
BetaManagedAgentsSessionThreadStatusTerminatedEvent object { id, agent_name, processed_at, 2 more }A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that terminated.
-
type: "session.thread_status_terminated""session.thread_status_terminated"
-
-
BetaManagedAgentsUserToolResultEvent object { id, tool_use_id, type, 4 more }Event sent by the client providing the result of an agent-toolset tool execution. Only valid on
self_hostedenvironments, where sandbox-routed tools are executed by the client rather than the server.-
id: stringUnique identifier for this event.
-
tool_use_id: stringThe id of the
agent.tool_useevent this result corresponds to, which can be found in the lastsession.status_idleevent'sstop_reason.event_idsfield. -
type: "user.tool_result""user.tool_result"
-
content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlockThe result content returned by the tool.
-
BetaManagedAgentsTextBlock object { text, type }Regular text content.
-
BetaManagedAgentsImageBlock object { source, type }Image content specified directly as base64 data or as a reference via a URL.
-
BetaManagedAgentsDocumentBlock object { source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
-
BetaManagedAgentsSearchResultBlock object { citations, content, source, 2 more }A block containing a web search result.
-
-
is_error: optional booleanWhether the tool execution resulted in an error.
-
processed_at: optional stringA timestamp in RFC 3339 format
-
session_thread_id: optional stringRoutes this result to a subagent thread. Copy from the
agent.tool_useevent'ssession_thread_id.
-
-
BetaManagedAgentsSessionThreadStatusRescheduledEvent object { id, agent_name, processed_at, 2 more }A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
-
id: stringUnique identifier for this event.
-
agent_name: stringName of the agent the thread runs.
-
processed_at: stringA timestamp in RFC 3339 format
-
session_thread_id: stringPublic sthr_ ID of the thread that is retrying.
-
type: "session.thread_status_rescheduled""session.thread_status_rescheduled"
-
-
BetaManagedAgentsSessionUpdatedEvent object { id, processed_at, type, 3 more }Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.
-
id: stringUnique identifier for this event.
-
processed_at: stringA timestamp in RFC 3339 format
-
type: "session.updated""session.updated"
-
agent: optional BetaManagedAgentsSessionAgentResolved
agentdefinition for asession. Snapshot of theagentatsessioncreation time.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url""url"
-
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
id: BetaManagedAgentsModelThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7" or "claude-opus-4-6" or "claude-sonnet-4-6" or 6 moreThe model that will power your agent.
See models for additional details and options.
-
"claude-opus-4-7"Frontier intelligence for long-running agents and coding
-
"claude-opus-4-6"Most intelligent model for building agents and coding
-
"claude-sonnet-4-6"Best combination of speed and intelligence
-
"claude-haiku-4-5"Fastest model with near-frontier intelligence
-
"claude-haiku-4-5-20251001"Fastest model with near-frontier intelligence
-
"claude-opus-4-5"Premium model combining maximum intelligence with practical performance
-
"claude-opus-4-5-20251101"Premium model combining maximum intelligence with practical performance
-
"claude-sonnet-4-5"High-performance model for agents and coding
-
"claude-sonnet-4-5-20250929"High-performance model for agents and coding
-
-
string
-
-
speed: optional "standard" or "fast"Inference speed mode.
fastprovides significantly faster output token generation at premium pricing. Not all models supportfast; invalid combinations are rejected at create time.-
"standard" -
"fast"
-
-
-
multiagent: BetaManagedAgentsSessionMultiagentCoordinatorResolved coordinator topology with full agent definitions for each roster member.
-
agents: array of BetaManagedAgentsSessionThreadAgentFull
agentdefinitions the coordinator may spawn as session threads.-
id: string -
description: string -
mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition-
name: string -
type: "url" -
url: string
-
-
model: BetaManagedAgentsModelConfigModel identifier and configuration.
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
skill_id: string -
type: "anthropic""anthropic"
-
version: string
-
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
skill_id: string -
type: "custom""custom"
-
version: string
-
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type }-
configs: array of BetaManagedAgentsAgentToolConfig-
enabled: boolean -
name: "bash" or "edit" or "read" or 5 moreBuilt-in agent tool identifier.
-
"bash" -
"edit" -
"read" -
"write" -
"glob" -
"grep" -
"web_fetch" -
"web_search"
-
-
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
type: "always_allow""always_allow"
-
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
type: "always_ask""always_ask"
-
-
-
-
default_config: BetaManagedAgentsAgentToolsetDefaultConfigResolved default configuration for agent tools.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
type: "agent_toolset_20260401""agent_toolset_20260401"
-
-
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type }-
configs: array of BetaManagedAgentsMCPToolConfig-
enabled: boolean -
name: string -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
default_config: BetaManagedAgentsMCPToolsetDefaultConfigResolved default configuration for all tools from an MCP server.
-
enabled: boolean -
permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicyPermission policy for tool execution.
-
BetaManagedAgentsAlwaysAllowPolicy object { type }Tool calls are automatically approved without user confirmation.
-
BetaManagedAgentsAlwaysAskPolicy object { type }Tool calls require user confirmation before execution.
-
-
-
mcp_server_name: string -
type: "mcp_toolset""mcp_toolset"
-
-
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
description: string -
input_schema: BetaManagedAgentsCustomToolInputSchemaJSON Schema for custom tool input parameters.
-
properties: optional map[unknown]JSON Schema properties defining the tool's input parameters.
-
required: optional array of stringList of required property names.
-
type: optional "object"Must be 'object' for tool input schemas.
"object"
-
-
name: string -
type: "custom""custom"
-
-
-
type: "agent""agent"
-
version: number
-
-
type: "coordinator""coordinator"
-
-
name: string -
skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill-
BetaManagedAgentsAnthropicSkill object { skill_id, type, version }A resolved Anthropic-managed skill.
-
BetaManagedAgentsCustomSkill object { skill_id, type, version }A resolved user-created custom skill.
-
-
system: string -
tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool-
BetaManagedAgentsAgentToolset20260401 object { configs, default_config, type } -
BetaManagedAgentsMCPToolset object { configs, default_config, mcp_server_name, type } -
BetaManagedAgentsCustomTool object { description, input_schema, name, type }A custom tool as returned in API responses.
-
-
type: "agent""agent"
-
version: number
-
-
metadata: optional map[string]The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.
-
title: optional stringThe session's new title. Present only when the update changed it.
-
-
Example
curl https://api.anthropic.com/v1/sessions/$SESSION_ID/threads/$THREAD_ID/stream \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: managed-agents-2026-04-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
Response
{
"id": "sevt_011CZkZGOp0iBcp4kaQSihUmy",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}