Stream Session Thread Events
$ ant beta:sessions:threads:events streamStream Session Thread Events
Parameters
Query param: When set, this connection also receives streaming deltas (event_start, event_delta) while an event is being produced, before the event itself arrives. Deltas are best-effort; when the final event is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no final event — its terminal span.model_request_end closes the preview. Accepts one or more event types to preview and may be repeated: agent.message streams content_delta fragments; agent.thinking is start-only — a signal that the agent has begun extended thinking, concluded by the agent.thinking event itself. Only previews of the requested event types are sent.
Returns
beta_managed_agents_stream_session_thread_events: 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 a single thread's stream.
Server-sent event in a single thread's stream.
content: array of BetaManagedAgentsTextBlock { text, type } or BetaManagedAgentsImageBlock { source, type } or BetaManagedAgentsDocumentBlock { source, type, context, title } or BetaManagedAgentsRedactedBlock { type }Array of content blocks comprising the user message.
Array of content blocks comprising the user message.
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.
The id of the agent.custom_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.
content: optional array of BetaManagedAgentsTextBlock { text, type } or BetaManagedAgentsImageBlock { source, type } or BetaManagedAgentsDocumentBlock { source, type, context, title } or BetaManagedAgentsSearchResultBlock { citations, content, source, 2 more }The result content returned by the tool.
The result content returned by the tool.
content: array of BetaManagedAgentsTextBlock { text, type } or BetaManagedAgentsRedactedBlock { type }Array of text blocks comprising the agent response.
Array of text blocks comprising the agent response.
content: optional array of BetaManagedAgentsTextBlock { text, type } or BetaManagedAgentsImageBlock { source, type } or BetaManagedAgentsDocumentBlock { source, type, context, title } or BetaManagedAgentsSearchResultBlock { citations, content, source, 2 more }The result content returned by the tool.
The result content returned by the tool.
content: optional array of BetaManagedAgentsTextBlock { text, type } or BetaManagedAgentsImageBlock { source, type } or BetaManagedAgentsDocumentBlock { source, type, context, title } or BetaManagedAgentsSearchResultBlock { citations, content, source, 2 more }The result content returned by the tool.
The result content returned by the tool.
content: array of BetaManagedAgentsTextBlock { text, type } or BetaManagedAgentsImageBlock { source, type } or BetaManagedAgentsDocumentBlock { source, type, context, title } or BetaManagedAgentsRedactedBlock { type }Message content blocks.
Message content blocks.
content: array of BetaManagedAgentsTextBlock { text, type } or BetaManagedAgentsImageBlock { source, type } or BetaManagedAgentsDocumentBlock { source, type, context, title } or BetaManagedAgentsRedactedBlock { type }Message content blocks.
Message content blocks.
error: BetaManagedAgentsUnknownError { message, retry_status, type } or BetaManagedAgentsModelOverloadedError { message, retry_status, type } or BetaManagedAgentsModelRateLimitedError { message, retry_status, type } or 5 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_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.
stop_reason: BetaManagedAgentsSessionEndTurn { type } or BetaManagedAgentsSessionRequiresAction { event_ids, type } or BetaManagedAgentsSessionRetriesExhausted { type } or BetaManagedAgentsSessionBudgetReached { 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.
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.
Human-readable explanation of the verdict. For needs_revision, describes which criteria failed and why.
Evaluation 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.
beta_managed_agents_span_outcome_evaluation_ongoing_event: 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.
Server-generated outc_ ID for this outcome. Referenced by span.outcome_evaluation_* events and the session's outcome_evaluations list.
rubric: BetaManagedAgentsFileRubric { file_id, type } or BetaManagedAgentsTextRubric { content, type }Rubric for grading the quality of an outcome.
Rubric for grading the quality of an outcome.
stop_reason: BetaManagedAgentsSessionEndTurn { type } or BetaManagedAgentsSessionRequiresAction { event_ids, type } or BetaManagedAgentsSessionRetriesExhausted { type } or BetaManagedAgentsSessionBudgetReached { 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.
The id of the agent.tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.
content: optional array of BetaManagedAgentsTextBlock { text, type } or BetaManagedAgentsImageBlock { source, type } or BetaManagedAgentsDocumentBlock { source, type, context, title } or BetaManagedAgentsSearchResultBlock { citations, content, source, 2 more }The result content returned by the tool.
The result content returned by the tool.
effort: optional BetaManagedAgentsEffortLow { type } or BetaManagedAgentsEffortMedium { type } or BetaManagedAgentsEffortHigh { type } or 2 moreHow hard Claude works on each turn. Sets output_config.effort on every Messages call the session makes.
How hard Claude works on each turn. Sets output_config.effort on every Messages call the session makes.
agents: array of BetaManagedAgentsSessionThreadAgent { id, description, mcp_servers, 7 more } or BetaManagedAgentsAdvisor { model, type }Full agent definitions the coordinator may spawn as session threads.
Full agent definitions the coordinator may spawn as session threads.
skills: array of BetaManagedAgentsAnthropicSkill { skill_id, type, version } or BetaManagedAgentsCustomSkill { skill_id, type, version }
tools: array of BetaManagedAgentsAgentToolset20260401 { configs, default_config, type } or BetaManagedAgentsMCPToolset { configs, default_config, mcp_server_name, type } or BetaManagedAgentsCustomTool { description, input_schema, name, type }
Opens a preview of a buffered event. Carries the previewed event's type and id only. Followed by zero or more event_delta events with the same event id, normally concluded by the buffered event carrying that id. If the producing model request ends without that event (an error or interrupt mid-stream), its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.
Opens a preview of a buffered event. Carries the previewed event's type and id only. Followed by zero or more event_delta events with the same event id, normally concluded by the buffered event carrying that id. If the producing model request ends without that event (an error or interrupt mid-stream), its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.
event: BetaManagedAgentsAgentMessagePreview { id, type } or BetaManagedAgentsAgentThinkingPreview { id, type }The previewed event's type and id. The event type determines which delta types the preview's event_delta events carry: agent.message events stream content_delta fragments; agent.thinking previews are start-only — no deltas follow, and the buffered agent.thinking with the same id concludes them.
The previewed event's type and id. The event type determines which delta types the preview's event_delta events carry: agent.message events stream content_delta fragments; agent.thinking previews are start-only — no deltas follow, and the buffered agent.thinking with the same id concludes them.
An incremental update to an event that is still being streamed. Deltas are best-effort and may stop early; when the buffered event with id == event_id is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no buffered event — its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.
An incremental update to an event that is still being streamed. Deltas are best-effort and may stop early; when the buffered event with id == event_id is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no buffered event — its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.
beta_managed_agents_stream_session_thread_events: 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 a single thread's stream.
Server-sent event in a single thread's stream.
Stream Session Thread Events
ant beta:sessions:threads:events stream \
--api-key my-anthropic-api-key \
--session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
--thread-id sthr_011CZkZVWa6oIjw0rgXZpnBt{
"id": "sevt_011CZkZGOp0iBcp4kaQSihUmy",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}Returns Examples
{
"id": "sevt_011CZkZGOp0iBcp4kaQSihUmy",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}