イベント
イベントの一覧
イベントを送信
イベントをストリーミング
Models
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_result event with the result.
Event emitted when the agent calls a custom tool. The session goes idle until the client sends a user.custom_tool_result event with the result.
Unique identifier for this event.
Input parameters for the tool call.
Name of the custom tool being called.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
When 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_result event to route the result back.
BetaManagedAgentsAgentMCPToolResultEvent object{ id, mcp_tool_use_id, processed_at, 3 more }Event representing the result of an MCP tool execution.
Event representing the result of an MCP tool execution.
BetaManagedAgentsAgentMCPToolUseEvent object{ id, input, mcp_server_name, 5 more }Event emitted when the agent invokes a tool provided by an MCP server.
Event emitted when the agent invokes a tool provided by an MCP server.
BetaManagedAgentsAgentMessageEvent object{ id, content, processed_at, type }An agent response event in the session conversation.
An agent response event in the session conversation.
BetaManagedAgentsAgentThinkingEvent object{ id, processed_at, type }Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
Unique identifier for this event.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
BetaManagedAgentsAgentThreadContextCompactedEvent object{ id, processed_at, type }Indicates that context compaction (summarization) occurred during the session.
Indicates that context compaction (summarization) occurred during the session.
Unique identifier for this event.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
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.
Delivery event written to the target thread's input stream when an agent-to-agent message arrives.
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.
Observability event emitted to the sender's output stream when an agent-to-agent message is sent.
BetaManagedAgentsAgentToolResultEvent object{ id, processed_at, tool_use_id, 3 more }Event representing the result of an agent tool execution.
Event representing the result of an agent tool execution.
BetaManagedAgentsAgentToolUseEvent object{ id, input, name, 4 more }Event emitted when the agent invokes a built-in agent tool.
Event emitted when the agent invokes a built-in agent tool.
Unique identifier for this event.
Input parameters for the tool call.
Name of the agent tool being used.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
evaluated_permission: optional "allow" or "ask" or "deny"AgentEvaluatedPermission enum
AgentEvaluatedPermission enum
When 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_confirmation event to route the approval back.
BetaManagedAgentsBase64DocumentSource object{ data, media_type, type }Base64-encoded document data.
Base64-encoded document data.
data: stringBase64-encoded document data.
Base64-encoded document data.
media_type: stringMIME type of the document (e.g., "application/pdf").
MIME type of the document (e.g., "application/pdf").
BetaManagedAgentsBase64ImageSource object{ data, media_type, type }Base64-encoded image data.
Base64-encoded image data.
data: stringBase64-encoded image data.
Base64-encoded image data.
media_type: stringMIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
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.
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.
BetaManagedAgentsCredentialHostUnreachableError object{ credential_id, message, retry_status, 2 more }An environment_variable credential's auth.networking.allowed_hosts includes a host the environment's network policy does not permit.
An environment_variable credential's auth.networking.allowed_hosts includes a host the environment's network policy does not permit.
BetaManagedAgentsDocumentBlock object{ source, type, context, title }Document content, either specified directly as base64 data, as text, or as a reference via a URL.
Document content, either specified directly as base64 data, as text, or as a reference via a URL.
BetaManagedAgentsEventParams = BetaManagedAgentsUserMessageEventParams { content, type } or BetaManagedAgentsUserInterruptEventParams { type, session_thread_id } or BetaManagedAgentsUserToolConfirmationEventParams { result, tool_use_id, type, deny_message } or 4 moreUnion type for event parameters that can be sent to a session.
Union type for event parameters that can be sent to a session.
BetaManagedAgentsFileDocumentSource object{ file_id, type }Document referenced by file ID.
Document referenced by file ID.
file_id: stringID of a previously uploaded file.
ID of a previously uploaded file.
BetaManagedAgentsFileImageSource object{ file_id, type }Image referenced by file ID.
Image referenced by file ID.
file_id: stringID of a previously uploaded file.
ID of a previously uploaded file.
BetaManagedAgentsFileRubric object{ file_id, type }Rubric referenced by a file uploaded via the Files API.
Rubric referenced by a file uploaded via the Files API.
ID of the rubric file.
BetaManagedAgentsFileRubricParams object{ file_id, type }Rubric referenced by a file uploaded via the Files API.
Rubric referenced by a file uploaded via the Files API.
ID of the rubric file.
BetaManagedAgentsImageBlock object{ source, type }Image content specified directly as base64 data or as a reference via a URL.
Image content specified directly as base64 data or as a reference via a URL.
BetaManagedAgentsMCPAuthenticationFailedError object{ mcp_server_name, message, retry_status, type }Authentication to an MCP server failed.
Authentication to an MCP server failed.
BetaManagedAgentsMCPConnectionFailedError object{ mcp_server_name, message, retry_status, type }Failed to connect to an MCP server.
Failed to connect to an MCP server.
BetaManagedAgentsModelOverloadedError object{ message, retry_status, type }The model is currently overloaded. Emitted after automatic retries are exhausted.
The model is currently overloaded. Emitted after automatic retries are exhausted.
BetaManagedAgentsModelRateLimitedError object{ message, retry_status, type }The model request was rate-limited.
The model request was rate-limited.
BetaManagedAgentsModelRequestFailedError object{ message, retry_status, type }A model request failed for a reason other than overload or rate-limiting.
A model request failed for a reason other than overload or rate-limiting.
BetaManagedAgentsPlainTextDocumentSource object{ data, media_type, type }Plain text document content.
Plain text document content.
data: stringThe plain text content.
The plain text content.
MIME type of the text content. Must be "text/plain".
BetaManagedAgentsRedactedBlock object{ type }Placeholder for content withheld by Anthropic model policy.
Placeholder for content withheld by Anthropic model policy.
BetaManagedAgentsRetryStatusExhausted object{ type }This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
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.
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.
BetaManagedAgentsRetryStatusTerminal object{ type }The session encountered a terminal error and will transition to terminated state.
The session encountered a terminal error and will transition to terminated state.
BetaManagedAgentsSearchResultBlock object{ citations, content, source, 2 more }A block containing a web search result.
A block containing a web search result.
citations: BetaManagedAgentsSearchResultCitations { enabled }Citation settings for a search result.
Citation settings for a search result.
Whether citations are enabled for this search result.
content: array of BetaManagedAgentsSearchResultContent { text, type }Array of text content blocks from the search result.
Array of text content blocks from the search result.
text: stringThe text content.
The text content.
source: stringThe URL source of the search result.
The URL source of the search result.
title: stringThe title of the search result.
The title of the search result.
BetaManagedAgentsSearchResultCitations object{ enabled }Citation settings for a search result.
Citation settings for a search result.
Whether citations are enabled for this search result.
BetaManagedAgentsSearchResultContent object{ text, type }Text content within a search result.
Text content within a search result.
text: stringThe text content.
The text content.
BetaManagedAgentsSendSessionEvents object{ data }Events that were successfully sent to the session.
Events that were successfully sent to the session.
BetaManagedAgentsSessionBudgetReached object{ type }The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.
The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.
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.
Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
Unique identifier for this event.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
BetaManagedAgentsSessionEndTurn object{ type }The agent completed its turn naturally and is ready for the next user message.
The agent completed its turn naturally and is ready for the next user message.
BetaManagedAgentsSessionErrorEvent object{ id, error, processed_at, type }An error event indicating a problem occurred during session execution.
An error event indicating a problem occurred during session execution.
BetaManagedAgentsSessionEvent = BetaManagedAgentsUserMessageEvent { id, content, type, processed_at } or BetaManagedAgentsUserInterruptEvent { id, type, processed_at, session_thread_id } or BetaManagedAgentsUserToolConfirmationEvent { id, result, tool_use_id, 4 more } or 32 moreUnion type for all event types in a session.
Union type for all event types in a session.
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.
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.
The ids of events the agent is blocked on. Resolving fewer than all re-emits session.status_idle with the remainder.
BetaManagedAgentsSessionRetriesExhausted object{ type }The turn ended because repeated errors exhausted the retry budget or an error escalated to retry_status: 'exhausted'.
The turn ended because repeated errors exhausted the retry budget or an error escalated to retry_status: 'exhausted'.
BetaManagedAgentsSessionStatusIdleEvent object{ id, processed_at, stop_reason, type }Indicates the agent has paused and is awaiting user input.
Indicates the agent has paused and is awaiting user input.
BetaManagedAgentsSessionStatusRescheduledEvent object{ id, processed_at, type }Indicates the session is recovering from an error state and is rescheduled for execution.
Indicates the session is recovering from an error state and is rescheduled for execution.
Unique identifier for this event.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
BetaManagedAgentsSessionStatusRunningEvent object{ id, processed_at, type }Indicates the session is actively running and the agent is working.
Indicates the session is actively running and the agent is working.
Unique identifier for this event.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
BetaManagedAgentsSessionStatusTerminatedEvent object{ id, processed_at, type }Indicates the session has terminated, either due to an error or completion.
Indicates the session has terminated, either due to an error or completion.
Unique identifier for this event.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
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.
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.
Unique identifier for this event.
Name of the callable agent the thread runs.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
Public sthr_ ID of the newly created thread.
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.
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.
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.
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.
Unique identifier for this event.
Name of the agent the thread runs.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
Public sthr_ ID of the thread that is retrying.
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.
A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.
Unique identifier for this event.
Name of the agent the thread runs.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
Public sthr_ ID of the thread that started running.
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.
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.
Unique identifier for this event.
Name of the agent the thread runs.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
Public sthr_ ID of the thread that terminated.
BetaManagedAgentsSessionUsageSnapshot object{ active_seconds, cache_creation, cache_read_input_tokens, 4 more }Point-in-time snapshot of a session's cumulative usage.
Point-in-time snapshot of a session's cumulative usage.
BetaManagedAgentsSpanModelRequestEndEvent object{ id, is_error, model_request_start_id, 3 more }Emitted when a model request completes.
Emitted when a model request completes.
BetaManagedAgentsSpanModelRequestStartEvent object{ id, processed_at, type }Emitted when a model request is initiated by the agent.
Emitted when a model request is initiated by the agent.
Unique identifier for this event.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
BetaManagedAgentsSpanModelUsage object{ cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }Token usage for a single model request.
Token usage for a single model request.
cache_creation_input_tokens: numberTokens used to create prompt cache in this request.
Tokens used to create prompt cache in this request.
cache_read_input_tokens: numberTokens read from prompt cache in this request.
Tokens read from prompt cache in this request.
input_tokens: numberInput tokens consumed by this request.
Input tokens consumed by this request.
output_tokens: numberOutput tokens generated by this request.
Output tokens generated by this request.
speed: optional "standard" or "fast" or nullInference speed mode. fast provides significantly faster output token generation at premium pricing. Not all models support fast; invalid combinations are rejected at create time.
Inference speed mode. fast provides significantly faster output token generation at premium pricing. Not all models support fast; invalid combinations are rejected at create time.
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_revision means another evaluation cycle follows; satisfied, max_iterations_reached, failed, or interrupted are terminal — no further evaluation cycles follow.
Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of needs_revision means another evaluation cycle follows; satisfied, max_iterations_reached, failed, or interrupted are terminal — no further evaluation cycles follow.
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_start and span.outcome_evaluation_end events.
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_start and span.outcome_evaluation_end events.
Unique identifier for this event.
iteration: number0-indexed revision cycle, matching the corresponding span.outcome_evaluation_start.
0-indexed revision cycle, matching the corresponding span.outcome_evaluation_start.
The outc_ ID of the outcome being evaluated.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
BetaManagedAgentsSpanOutcomeEvaluationStartEvent object{ id, iteration, outcome_id, 2 more }Emitted when an outcome evaluation cycle begins.
Emitted when an outcome evaluation cycle begins.
Unique identifier for this event.
iteration: number0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.
0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.
The outc_ ID of the outcome being evaluated.
processed_at: stringA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
BetaManagedAgentsStreamSessionEvents = BetaManagedAgentsUserMessageEvent { id, content, type, processed_at } or BetaManagedAgentsUserInterruptEvent { id, type, processed_at, session_thread_id } or BetaManagedAgentsUserToolConfirmationEvent { id, result, tool_use_id, 4 more } or 34 moreServer-sent event in the session stream.
Server-sent event in the session stream.
BetaManagedAgentsSystemMessageEventParams object{ content, type }Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a role: "system" turn rather than replacing the top-level system prompt. At most one per request: it must be the final event and immediately follow the user.message, user.tool_result, or user.custom_tool_result it accompanies. Only supported on models that accept mid-conversation system messages.
Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a role: "system" turn rather than replacing the top-level system prompt. At most one per request: it must be the final event and immediately follow the user.message, user.tool_result, or user.custom_tool_result it accompanies. Only supported on models that accept mid-conversation system messages.
content: array of BetaManagedAgentsSystemContentBlock { text, type }System content blocks to append. Text-only.
System content blocks to append. Text-only.
text: stringThe text content.
The text content.
BetaManagedAgentsTextBlock object{ text, type }Regular text content.
Regular text content.
text: stringThe text content.
The text content.
BetaManagedAgentsTextRubric object{ content, type }Rubric content provided inline as text.
Rubric content provided inline as text.
Rubric content. Plain text or markdown — the grader treats it as freeform text.
BetaManagedAgentsTextRubricParams object{ content, type }Rubric content provided inline as text.
Rubric content provided inline as text.
content: stringRubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.
Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.
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_status and message alone.
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_status and message alone.
BetaManagedAgentsURLDocumentSource object{ type, url }Document referenced by URL.
Document referenced by URL.
url: stringURL of the document to fetch.
URL of the document to fetch.
BetaManagedAgentsURLImageSource object{ type, url }Image referenced by URL.
Image referenced by URL.
url: stringURL of the image to fetch.
URL of the image to fetch.
BetaManagedAgentsUserCustomToolResultEvent object{ id, custom_tool_use_id, type, 4 more }Event sent by the client providing the result of a custom tool execution.
Event sent by the client providing the result of a custom tool execution.
BetaManagedAgentsUserCustomToolResultEventParams object{ custom_tool_use_id, type, content, is_error }Parameters for providing the result of a custom tool execution.
Parameters for providing the result of a custom tool execution.
BetaManagedAgentsUserDefineOutcomeEvent object{ id, description, max_iterations, 4 more }Echo of a user.define_outcome input event. Carries the server-generated outcome_id that subsequent span.outcome_evaluation_* events reference.
Echo of a user.define_outcome input event. Carries the server-generated outcome_id that subsequent span.outcome_evaluation_* events reference.
BetaManagedAgentsUserDefineOutcomeEventParams object{ description, rubric, type, max_iterations }Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.
Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.
BetaManagedAgentsUserInterruptEvent object{ id, type, processed_at, session_thread_id }An interrupt event that pauses agent execution and returns control to the user.
An interrupt event that pauses agent execution and returns control to the user.
Unique identifier for this event.
processed_at: optional string or nullA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
If 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.
BetaManagedAgentsUserInterruptEventParams object{ type, session_thread_id }Parameters for sending an interrupt to pause the agent.
Parameters for sending an interrupt to pause the agent.
If 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.
BetaManagedAgentsUserMessageEvent object{ id, content, type, processed_at }A user message event in the session conversation.
A user message event in the session conversation.
BetaManagedAgentsUserMessageEventParams object{ content, type }Parameters for sending a user message to the session.
Parameters for sending a user message to the session.
BetaManagedAgentsUserToolConfirmationEvent object{ id, result, tool_use_id, 4 more }A tool confirmation event that approves or denies a pending tool execution.
A tool confirmation event that approves or denies a pending tool execution.
BetaManagedAgentsUserToolConfirmationEventParams object{ result, tool_use_id, type, deny_message }Parameters for confirming or denying a tool execution request.
Parameters for confirming or denying a tool execution request.
result: "allow" or "deny"UserToolConfirmationResult enum
UserToolConfirmationResult enum
tool_use_id: stringThe id of the agent.tool_use or agent.mcp_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.
The id of the agent.tool_use or agent.mcp_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.
deny_message: optional string or nullOptional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
BetaManagedAgentsUserToolResultEventParams object{ tool_use_id, type, content, is_error }Parameters for providing the result of an agent-toolset tool execution. Only valid on self_hosted environments, where sandbox-routed tools are executed by the client rather than the server.
Parameters for providing the result of an agent-toolset tool execution. Only valid on self_hosted environments, where sandbox-routed tools are executed by the client rather than the server.