SPB Git

Repository Public

stream.md 74.4 KB 2,440 lines markdown

1---2title: Stream Session Thread Events3url: https://platform.claude.com/docs/en/api/beta/sessions/threads/events/stream4---56# Stream Session Thread Events78**GET** `/v1/sessions/{session_id}/threads/{thread_id}/stream`910Stream Session Thread Events1112## Path parameters1314- `session_id: string`1516- `thread_id: string`1718## Query parameters1920- `event_deltas: optional array of BetaManagedAgentsDeltaType`2122  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.2324  - `"agent.message"`2526  - `"agent.thinking"`2728## Headers2930- `"anthropic-beta": optional array of AnthropicBeta`3132  Optional header to specify the beta version(s) you want to use.3334  - `string`3536  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`3738    - `"message-batches-2024-09-24"`3940    - `"prompt-caching-2024-07-31"`4142    - `"computer-use-2024-10-22"`4344    - `"computer-use-2025-01-24"`4546    - `"pdfs-2024-09-25"`4748    - `"token-counting-2024-11-01"`4950    - `"token-efficient-tools-2025-02-19"`5152    - `"output-128k-2025-02-19"`5354    - `"files-api-2025-04-14"`5556    - `"mcp-client-2025-04-04"`5758    - `"mcp-client-2025-11-20"`5960    - `"dev-full-thinking-2025-05-14"`6162    - `"interleaved-thinking-2025-05-14"`6364    - `"code-execution-2025-05-22"`6566    - `"extended-cache-ttl-2025-04-11"`6768    - `"context-1m-2025-08-07"`6970    - `"context-management-2025-06-27"`7172    - `"model-context-window-exceeded-2025-08-26"`7374    - `"skills-2025-10-02"`7576    - `"fast-mode-2026-02-01"`7778    - `"output-300k-2026-03-24"`7980    - `"user-profiles-2026-03-24"`8182    - `"user-profiles-2026-08-18"`8384    - `"user-profiles-2026-09-04"`8586    - `"advisor-tool-2026-03-01"`8788    - `"managed-agents-2026-04-01"`8990    - `"cache-diagnosis-2026-04-07"`9192    - `"dreaming-2026-04-21"`9394    - `"thinking-token-count-2026-05-13"`9596    - `"server-side-fallback-2026-06-01"`9798    - `"server-side-fallback-2026-07-01"`99100    - `"fallback-credit-2026-06-01"`101102    - `"fallback-credit-2026-07-01"`103104    - `"agent-memory-2026-07-22"`105106    - `"mid-conversation-tool-changes-2026-07-01"`107108    - `"compact-2026-01-12"`109110    - `"computer-use-2025-11-24"`111112    - `"mcp-tunnels-2026-06-22"`113114    - `"structured-outputs-2025-11-13"`115116    - `"task-budgets-2026-03-13"`117118    - `"thinking-display-updates-2026-08-18"`119120    - `"ce-user-management-2026-07-13"`121122    - `"mid-conversation-output-config-2026-07-01"`123124    - `"thinking-binding-controls-2026-08-01"`125126    - `"mid-conversation-system-clear-at-2026-08-21"`127128    - `"compact-2026-09-04"`129130- `"anthropic-workspace-id": optional string`131132## Returns133134- `BetaManagedAgentsStreamSessionThreadEvents = BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 34 more`135136  Server-sent event in a single thread's stream.137138  - `BetaManagedAgentsUserMessageEvent object`139140    A user message event in the session conversation.141142    - `type: "user.message"`143144    - `id: string`145146      Unique identifier for this event.147148    - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsRedactedBlock`149150      Array of content blocks comprising the user message.151152      - `BetaManagedAgentsTextBlock object`153154        Regular text content.155156        - `type: "text"`157158        - `text: string`159160          The text content.161162          minLength: 1163164      - `BetaManagedAgentsImageBlock object`165166        Image content specified directly as base64 data or as a reference via a URL.167168        - `type: "image"`169170        - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`171172          Union type for image source variants.173174          - `BetaManagedAgentsBase64ImageSource object`175176            Base64-encoded image data.177178            - `type: "base64"`179180            - `data: string`181182              Base64-encoded image data.183184              minLength: 1185186            - `media_type: string`187188              MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").189190              minLength: 1191192          - `BetaManagedAgentsURLImageSource object`193194            Image referenced by URL.195196            - `type: "url"`197198            - `url: string`199200              URL of the image to fetch.201202              minLength: 1203204          - `BetaManagedAgentsFileImageSource object`205206            Image referenced by file ID.207208            - `type: "file"`209210            - `file_id: string`211212              ID of a previously uploaded file.213214              minLength: 1215216      - `BetaManagedAgentsDocumentBlock object`217218        Document content, either specified directly as base64 data, as text, or as a reference via a URL.219220        - `type: "document"`221222        - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`223224          Union type for document source variants.225226          - `BetaManagedAgentsBase64DocumentSource object`227228            Base64-encoded document data.229230            - `type: "base64"`231232            - `data: string`233234              Base64-encoded document data.235236              minLength: 1237238            - `media_type: string`239240              MIME type of the document (e.g., "application/pdf").241242              minLength: 1243244          - `BetaManagedAgentsPlainTextDocumentSource object`245246            Plain text document content.247248            - `type: "text"`249250            - `data: string`251252              The plain text content.253254              minLength: 1255256            - `media_type: "text/plain"`257258              MIME type of the text content. Must be "text/plain".259260          - `BetaManagedAgentsURLDocumentSource object`261262            Document referenced by URL.263264            - `type: "url"`265266            - `url: string`267268              URL of the document to fetch.269270              minLength: 1271272          - `BetaManagedAgentsFileDocumentSource object`273274            Document referenced by file ID.275276            - `type: "file"`277278            - `file_id: string`279280              ID of a previously uploaded file.281282              minLength: 1283284        - `context: optional string or null`285286          Additional context about the document for the model.287288        - `title: optional string or null`289290          The title of the document.291292      - `BetaManagedAgentsRedactedBlock object`293294        Placeholder for content withheld by Anthropic model policy.295296        - `type: "redacted"`297298    - `processed_at: optional string or null`299300      A timestamp in RFC 3339 format301302      format: date-time303304  - `BetaManagedAgentsUserInterruptEvent object`305306    An interrupt event that pauses agent execution and returns control to the user.307308    - `type: "user.interrupt"`309310    - `id: string`311312      Unique identifier for this event.313314    - `processed_at: optional string or null`315316      A timestamp in RFC 3339 format317318      format: date-time319320    - `session_thread_id: optional string or null`321322      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.323324  - `BetaManagedAgentsUserToolConfirmationEvent object`325326    A tool confirmation event that approves or denies a pending tool execution.327328    - `type: "user.tool_confirmation"`329330    - `id: string`331332      Unique identifier for this event.333334    - `result: "allow" or "deny"`335336      UserToolConfirmationResult enum337338      - `"allow"`339340      - `"deny"`341342    - `tool_use_id: string`343344      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](https://platform.claude.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.345346    - `deny_message: optional string or null`347348      Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.349350      maxLength: 10000351352    - `processed_at: optional string or null`353354      A timestamp in RFC 3339 format355356      format: date-time357358    - `session_thread_id: optional string or null`359360      Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread.361362  - `BetaManagedAgentsUserCustomToolResultEvent object`363364    Event sent by the client providing the result of a custom tool execution.365366    - `type: "user.custom_tool_result"`367368    - `id: string`369370      Unique identifier for this event.371372    - `custom_tool_use_id: string`373374      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](https://platform.claude.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.375376    - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlock`377378      The result content returned by the tool.379380      - `BetaManagedAgentsTextBlock object`381382        Regular text content.383384      - `BetaManagedAgentsImageBlock object`385386        Image content specified directly as base64 data or as a reference via a URL.387388      - `BetaManagedAgentsDocumentBlock object`389390        Document content, either specified directly as base64 data, as text, or as a reference via a URL.391392      - `BetaManagedAgentsSearchResultBlock object`393394        A block containing a web search result.395396        - `type: "search_result"`397398        - `citations: BetaManagedAgentsSearchResultCitations`399400          Citation settings for a search result.401402          - `enabled: boolean`403404            Whether citations are enabled for this search result.405406        - `content: array of BetaManagedAgentsSearchResultContent`407408          Array of text content blocks from the search result.409410          - `type: "text"`411412          - `text: string`413414            The text content.415416            minLength: 1417418        - `source: string`419420          The URL source of the search result.421422          minLength: 1423424        - `title: string`425426          The title of the search result.427428          minLength: 1429430    - `is_error: optional boolean or null`431432      Whether the tool execution resulted in an error.433434    - `processed_at: optional string or null`435436      A timestamp in RFC 3339 format437438      format: date-time439440    - `session_thread_id: optional string or null`441442      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.443444  - `BetaManagedAgentsAgentCustomToolUseEvent object`445446    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.447448    - `type: "agent.custom_tool_use"`449450    - `id: string`451452      Unique identifier for this event.453454    - `input: map[unknown]`455456      Input parameters for the tool call.457458    - `name: string`459460      Name of the custom tool being called.461462    - `processed_at: string`463464      A timestamp in RFC 3339 format465466      format: date-time467468    - `session_thread_id: optional string or null`469470      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. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back.471472  - `BetaManagedAgentsAgentMessageEvent object`473474    An agent response event in the session conversation.475476    - `type: "agent.message"`477478    - `id: string`479480      Unique identifier for this event.481482    - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsRedactedBlock`483484      Array of text blocks comprising the agent response.485486      - `BetaManagedAgentsTextBlock object`487488        Regular text content.489490      - `BetaManagedAgentsRedactedBlock object`491492        Placeholder for content withheld by Anthropic model policy.493494    - `processed_at: string`495496      A timestamp in RFC 3339 format497498      format: date-time499500  - `BetaManagedAgentsAgentThinkingEvent object`501502    Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.503504    - `type: "agent.thinking"`505506    - `id: string`507508      Unique identifier for this event.509510    - `processed_at: string`511512      A timestamp in RFC 3339 format513514      format: date-time515516  - `BetaManagedAgentsAgentMCPToolUseEvent object`517518    Event emitted when the agent invokes a tool provided by an MCP server.519520    - `type: "agent.mcp_tool_use"`521522    - `id: string`523524      Unique identifier for this event.525526    - `input: map[unknown]`527528      Input parameters for the tool call.529530    - `mcp_server_name: string`531532      Name of the MCP server providing the tool.533534    - `name: string`535536      Name of the MCP tool being used.537538    - `processed_at: string`539540      A timestamp in RFC 3339 format541542      format: date-time543544    - `evaluated_permission: optional "allow" or "ask" or "deny"`545546      AgentEvaluatedPermission enum547548      - `"allow"`549550      - `"ask"`551552      - `"deny"`553554    - `evaluation: optional BetaManagedAgentsAgentToolEvaluation`555556      Names the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants.557558      - `BetaManagedAgentsAgentToolEvaluationAlwaysAllow object`559560        The resolved permission_policy was always_allow; accompanies evaluated_permission "allow".561562        - `type: "always_allow"`563564      - `BetaManagedAgentsAgentToolEvaluationAlwaysAsk object`565566        The resolved permission_policy was always_ask; accompanies evaluated_permission "ask".567568        - `type: "always_ask"`569570      - `BetaManagedAgentsAgentToolEvaluationAuto object`571572        The resolved permission_policy was auto: the server judged this invocation individually.573574        - `type: "auto"`575576        - `evaluated_permission: BetaManagedAgentsAgentAutoEvaluatedPermission`577578          The server's per-invocation judgement under the auto permission policy. Its type always equals the event's top-level evaluated_permission. Open union: clients must tolerate unknown variants.579580          - `BetaManagedAgentsAgentAutoEvaluatedPermissionAllow object`581582            The server judged the invocation safe to execute without client approval.583584            - `type: "allow"`585586          - `BetaManagedAgentsAgentAutoEvaluatedPermissionAsk object`587588            The server reached no judgement; the invocation is held for client approval.589590            - `type: "ask"`591592            - `reason_code: string`593594              The judgement's grounds in registry-bound terms, for client branching and audit rather than end-user display. Open registry; currently "indeterminate" (no judgement was reached). Clients must tolerate values outside this set.595596              maxLength: 64597598          - `BetaManagedAgentsAgentAutoEvaluatedPermissionDeny object`599600            The server judged the invocation high-risk; it does not execute and a synthetic error tool result is appended.601602            - `type: "deny"`603604            - `reason_code: string`605606              The judgement's grounds in registry-bound terms. Open registry; currently "high_risk" (judged high-risk; the call does not run). Clients must tolerate values outside this set.607608              maxLength: 64609610    - `session_thread_id: optional string or null`611612      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. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back.613614  - `BetaManagedAgentsAgentMCPToolResultEvent object`615616    Event representing the result of an MCP tool execution.617618    - `type: "agent.mcp_tool_result"`619620    - `id: string`621622      Unique identifier for this event.623624    - `mcp_tool_use_id: string`625626      The id of the `agent.mcp_tool_use` event this result corresponds to.627628    - `processed_at: string`629630      A timestamp in RFC 3339 format631632      format: date-time633634    - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlock`635636      The result content returned by the tool.637638      - `BetaManagedAgentsTextBlock object`639640        Regular text content.641642      - `BetaManagedAgentsImageBlock object`643644        Image content specified directly as base64 data or as a reference via a URL.645646      - `BetaManagedAgentsDocumentBlock object`647648        Document content, either specified directly as base64 data, as text, or as a reference via a URL.649650      - `BetaManagedAgentsSearchResultBlock object`651652        A block containing a web search result.653654    - `is_error: optional boolean or null`655656      Whether the tool execution resulted in an error.657658  - `BetaManagedAgentsAgentToolUseEvent object`659660    Event emitted when the agent invokes a built-in agent tool.661662    - `type: "agent.tool_use"`663664    - `id: string`665666      Unique identifier for this event.667668    - `input: map[unknown]`669670      Input parameters for the tool call.671672    - `name: string`673674      Name of the agent tool being used.675676    - `processed_at: string`677678      A timestamp in RFC 3339 format679680      format: date-time681682    - `evaluated_permission: optional "allow" or "ask" or "deny"`683684      AgentEvaluatedPermission enum685686      - `"allow"`687688      - `"ask"`689690      - `"deny"`691692    - `evaluation: optional BetaManagedAgentsAgentToolEvaluation`693694      Names the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants.695696    - `session_thread_id: optional string or null`697698      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. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back.699700  - `BetaManagedAgentsAgentToolResultEvent object`701702    Event representing the result of an agent tool execution.703704    - `type: "agent.tool_result"`705706    - `id: string`707708      Unique identifier for this event.709710    - `processed_at: string`711712      A timestamp in RFC 3339 format713714      format: date-time715716    - `tool_use_id: string`717718      The id of the `agent.tool_use` event this result corresponds to.719720    - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlock`721722      The result content returned by the tool.723724      - `BetaManagedAgentsTextBlock object`725726        Regular text content.727728      - `BetaManagedAgentsImageBlock object`729730        Image content specified directly as base64 data or as a reference via a URL.731732      - `BetaManagedAgentsDocumentBlock object`733734        Document content, either specified directly as base64 data, as text, or as a reference via a URL.735736      - `BetaManagedAgentsSearchResultBlock object`737738        A block containing a web search result.739740    - `is_error: optional boolean or null`741742      Whether the tool execution resulted in an error.743744  - `BetaManagedAgentsAgentThreadMessageReceivedEvent object`745746    Delivery event written to the target thread's input stream when an agent-to-agent message arrives.747748    - `type: "agent.thread_message_received"`749750    - `id: string`751752      Unique identifier for this event.753754    - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsRedactedBlock`755756      Message content blocks.757758      - `BetaManagedAgentsTextBlock object`759760        Regular text content.761762      - `BetaManagedAgentsImageBlock object`763764        Image content specified directly as base64 data or as a reference via a URL.765766      - `BetaManagedAgentsDocumentBlock object`767768        Document content, either specified directly as base64 data, as text, or as a reference via a URL.769770      - `BetaManagedAgentsRedactedBlock object`771772        Placeholder for content withheld by Anthropic model policy.773774    - `from_session_thread_id: string`775776      Public `sthr_` ID of the thread that sent the message.777778    - `processed_at: string`779780      A timestamp in RFC 3339 format781782      format: date-time783784    - `from_agent_name: optional string or null`785786      Name of the callable agent this message came from. Absent when received from the primary agent.787788  - `BetaManagedAgentsAgentThreadMessageSentEvent object`789790    Observability event emitted to the sender's output stream when an agent-to-agent message is sent.791792    - `type: "agent.thread_message_sent"`793794    - `id: string`795796      Unique identifier for this event.797798    - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsRedactedBlock`799800      Message content blocks.801802      - `BetaManagedAgentsTextBlock object`803804        Regular text content.805806      - `BetaManagedAgentsImageBlock object`807808        Image content specified directly as base64 data or as a reference via a URL.809810      - `BetaManagedAgentsDocumentBlock object`811812        Document content, either specified directly as base64 data, as text, or as a reference via a URL.813814      - `BetaManagedAgentsRedactedBlock object`815816        Placeholder for content withheld by Anthropic model policy.817818    - `processed_at: string`819820      A timestamp in RFC 3339 format821822      format: date-time823824    - `to_session_thread_id: string`825826      Public `sthr_` ID of the thread the message was sent to.827828    - `to_agent_name: optional string or null`829830      Name of the callable agent this message was sent to. Absent when sent to the primary agent.831832  - `BetaManagedAgentsAgentThreadContextCompactedEvent object`833834    Indicates that context compaction (summarization) occurred during the session.835836    - `type: "agent.thread_context_compacted"`837838    - `id: string`839840      Unique identifier for this event.841842    - `processed_at: string`843844      A timestamp in RFC 3339 format845846      format: date-time847848  - `BetaManagedAgentsSessionErrorEvent object`849850    An error event indicating a problem occurred during session execution.851852    - `type: "session.error"`853854    - `id: string`855856      Unique identifier for this event.857858    - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 5 more`859860      - `BetaManagedAgentsUnknownError object`861862        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.863864        - `type: "unknown_error"`865866        - `message: string`867868          Human-readable error description.869870        - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`871872          What the client should do next in response to this error.873874          - `BetaManagedAgentsRetryStatusRetrying object`875876            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.877878            - `type: "retrying"`879880          - `BetaManagedAgentsRetryStatusExhausted object`881882            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.883884            - `type: "exhausted"`885886          - `BetaManagedAgentsRetryStatusTerminal object`887888            The session encountered a terminal error and will transition to `terminated` state.889890            - `type: "terminal"`891892      - `BetaManagedAgentsModelOverloadedError object`893894        The model is currently overloaded. Emitted after automatic retries are exhausted.895896        - `type: "model_overloaded_error"`897898        - `message: string`899900          Human-readable error description.901902        - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`903904          What the client should do next in response to this error.905906          - `BetaManagedAgentsRetryStatusRetrying object`907908            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.909910          - `BetaManagedAgentsRetryStatusExhausted object`911912            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.913914          - `BetaManagedAgentsRetryStatusTerminal object`915916            The session encountered a terminal error and will transition to `terminated` state.917918      - `BetaManagedAgentsModelRateLimitedError object`919920        The model request was rate-limited.921922        - `type: "model_rate_limited_error"`923924        - `message: string`925926          Human-readable error description.927928        - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`929930          What the client should do next in response to this error.931932          - `BetaManagedAgentsRetryStatusRetrying object`933934            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.935936          - `BetaManagedAgentsRetryStatusExhausted object`937938            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.939940          - `BetaManagedAgentsRetryStatusTerminal object`941942            The session encountered a terminal error and will transition to `terminated` state.943944      - `BetaManagedAgentsModelRequestFailedError object`945946        A model request failed for a reason other than overload or rate-limiting.947948        - `type: "model_request_failed_error"`949950        - `message: string`951952          Human-readable error description.953954        - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`955956          What the client should do next in response to this error.957958          - `BetaManagedAgentsRetryStatusRetrying object`959960            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.961962          - `BetaManagedAgentsRetryStatusExhausted object`963964            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.965966          - `BetaManagedAgentsRetryStatusTerminal object`967968            The session encountered a terminal error and will transition to `terminated` state.969970      - `BetaManagedAgentsMCPConnectionFailedError object`971972        Failed to connect to an MCP server.973974        - `type: "mcp_connection_failed_error"`975976        - `mcp_server_name: string`977978          Name of the MCP server that failed to connect.979980        - `message: string`981982          Human-readable error description.983984        - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`985986          What the client should do next in response to this error.987988          - `BetaManagedAgentsRetryStatusRetrying object`989990            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.991992          - `BetaManagedAgentsRetryStatusExhausted object`993994            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.995996          - `BetaManagedAgentsRetryStatusTerminal object`997998            The session encountered a terminal error and will transition to `terminated` state.9991000      - `BetaManagedAgentsMCPAuthenticationFailedError object`10011002        Authentication to an MCP server failed.10031004        - `type: "mcp_authentication_failed_error"`10051006        - `mcp_server_name: string`10071008          Name of the MCP server that failed authentication.10091010        - `message: string`10111012          Human-readable error description.10131014        - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`10151016          What the client should do next in response to this error.10171018          - `BetaManagedAgentsRetryStatusRetrying object`10191020            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.10211022          - `BetaManagedAgentsRetryStatusExhausted object`10231024            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.10251026          - `BetaManagedAgentsRetryStatusTerminal object`10271028            The session encountered a terminal error and will transition to `terminated` state.10291030      - `BetaManagedAgentsBillingError object`10311032        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.10331034        - `type: "billing_error"`10351036        - `message: string`10371038          Human-readable error description.10391040        - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`10411042          What the client should do next in response to this error.10431044          - `BetaManagedAgentsRetryStatusRetrying object`10451046            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.10471048          - `BetaManagedAgentsRetryStatusExhausted object`10491050            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.10511052          - `BetaManagedAgentsRetryStatusTerminal object`10531054            The session encountered a terminal error and will transition to `terminated` state.10551056      - `BetaManagedAgentsCredentialHostUnreachableError object`10571058        An `environment_variable` credential's `auth.networking.allowed_hosts` includes a host the environment's network policy does not permit.10591060        - `type: "credential_host_unreachable_error"`10611062        - `credential_id: string`10631064          ID of the affected credential.10651066        - `message: string`10671068          Human-readable error description.10691070        - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`10711072          What the client should do next in response to this error.10731074          - `BetaManagedAgentsRetryStatusRetrying object`10751076            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.10771078          - `BetaManagedAgentsRetryStatusExhausted object`10791080            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.10811082          - `BetaManagedAgentsRetryStatusTerminal object`10831084            The session encountered a terminal error and will transition to `terminated` state.10851086        - `vault_id: string`10871088          ID of the vault containing the affected credential.10891090    - `processed_at: string`10911092      A timestamp in RFC 3339 format10931094      format: date-time10951096  - `BetaManagedAgentsSessionStatusRescheduledEvent object`10971098    Indicates the session is recovering from an error state and is rescheduled for execution.10991100    - `type: "session.status_rescheduled"`11011102    - `id: string`11031104      Unique identifier for this event.11051106    - `processed_at: string`11071108      A timestamp in RFC 3339 format11091110      format: date-time11111112  - `BetaManagedAgentsSessionStatusRunningEvent object`11131114    Indicates the session is actively running and the agent is working.11151116    - `type: "session.status_running"`11171118    - `id: string`11191120      Unique identifier for this event.11211122    - `processed_at: string`11231124      A timestamp in RFC 3339 format11251126      format: date-time11271128  - `BetaManagedAgentsSessionStatusIdleEvent object`11291130    Indicates the agent has paused and is awaiting user input.11311132    - `type: "session.status_idle"`11331134    - `id: string`11351136      Unique identifier for this event.11371138    - `processed_at: string`11391140      A timestamp in RFC 3339 format11411142      format: date-time11431144    - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted or BetaManagedAgentsSessionBudgetReached`11451146      - `BetaManagedAgentsSessionEndTurn object`11471148        The agent completed its turn naturally and is ready for the next user message.11491150        - `type: "end_turn"`11511152      - `BetaManagedAgentsSessionRequiresAction object`11531154        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.11551156        - `type: "requires_action"`11571158        - `event_ids: array of string`11591160          The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.11611162      - `BetaManagedAgentsSessionRetriesExhausted object`11631164        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.11651166        - `type: "retries_exhausted"`11671168      - `BetaManagedAgentsSessionBudgetReached object`11691170        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.11711172        - `type: "budget_reached"`11731174  - `BetaManagedAgentsSessionStatusTerminatedEvent object`11751176    Indicates the session has terminated, either due to an error or completion.11771178    - `type: "session.status_terminated"`11791180    - `id: string`11811182      Unique identifier for this event.11831184    - `processed_at: string`11851186      A timestamp in RFC 3339 format11871188      format: date-time11891190  - `BetaManagedAgentsSessionThreadCreatedEvent object`11911192    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.11931194    - `type: "session.thread_created"`11951196    - `id: string`11971198      Unique identifier for this event.11991200    - `agent_name: string`12011202      Name of the callable agent the thread runs.12031204    - `processed_at: string`12051206      A timestamp in RFC 3339 format12071208      format: date-time12091210    - `session_thread_id: string`12111212      Public `sthr_` ID of the newly created thread.12131214  - `BetaManagedAgentsSpanOutcomeEvaluationStartEvent object`12151216    Emitted when an outcome evaluation cycle begins.12171218    - `type: "span.outcome_evaluation_start"`12191220    - `id: string`12211222      Unique identifier for this event.12231224    - `iteration: number`12251226      0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.12271228      format: int3212291230    - `outcome_id: string`12311232      The `outc_` ID of the outcome being evaluated.12331234    - `processed_at: string`12351236      A timestamp in RFC 3339 format12371238      format: date-time12391240  - `BetaManagedAgentsSpanOutcomeEvaluationEndEvent object`12411242    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.12431244    - `type: "span.outcome_evaluation_end"`12451246    - `id: string`12471248      Unique identifier for this event.12491250    - `explanation: string`12511252      Human-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why.12531254    - `iteration: number`12551256      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.12571258      format: int3212591260    - `outcome_evaluation_start_id: string`12611262      The id of the corresponding `span.outcome_evaluation_start` event.12631264    - `outcome_id: string`12651266      The `outc_` ID of the outcome being evaluated.12671268    - `processed_at: string`12691270      A timestamp in RFC 3339 format12711272      format: date-time12731274    - `result: string`12751276      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.12771278    - `usage: BetaManagedAgentsSpanModelUsage`12791280      Token usage for a single model request.12811282      - `cache_creation_input_tokens: number`12831284        Tokens used to create prompt cache in this request.12851286        format: int3212871288      - `cache_read_input_tokens: number`12891290        Tokens read from prompt cache in this request.12911292        format: int3212931294      - `input_tokens: number`12951296        Input tokens consumed by this request.12971298        format: int3212991300      - `output_tokens: number`13011302        Output tokens generated by this request.13031304        format: int3213051306      - `speed: optional "standard" or "fast" or null`13071308        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.13091310        - `"standard"`13111312        - `"fast"`13131314  - `BetaManagedAgentsSpanModelRequestStartEvent object`13151316    Emitted when a model request is initiated by the agent.13171318    - `type: "span.model_request_start"`13191320    - `id: string`13211322      Unique identifier for this event.13231324    - `processed_at: string`13251326      A timestamp in RFC 3339 format13271328      format: date-time13291330  - `BetaManagedAgentsSpanModelRequestEndEvent object`13311332    Emitted when a model request completes.13331334    - `type: "span.model_request_end"`13351336    - `id: string`13371338      Unique identifier for this event.13391340    - `is_error: boolean or null`13411342      Whether the model request resulted in an error.13431344    - `model_request_start_id: string`13451346      The id of the corresponding `span.model_request_start` event.13471348    - `model_usage: BetaManagedAgentsSpanModelUsage`13491350      Token usage for a single model request.13511352    - `processed_at: string`13531354      A timestamp in RFC 3339 format13551356      format: date-time13571358  - `BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent object`13591360    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.13611362    - `type: "span.outcome_evaluation_ongoing"`13631364    - `id: string`13651366      Unique identifier for this event.13671368    - `iteration: number`13691370      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.13711372      format: int3213731374    - `outcome_id: string`13751376      The `outc_` ID of the outcome being evaluated.13771378    - `processed_at: string`13791380      A timestamp in RFC 3339 format13811382      format: date-time13831384  - `BetaManagedAgentsUserDefineOutcomeEvent object`13851386    Echo of a `user.define_outcome` input event. Carries the server-generated `outcome_id` that subsequent `span.outcome_evaluation_*` events reference.13871388    - `type: "user.define_outcome"`13891390    - `id: string`13911392      Unique identifier for this event.13931394    - `description: string`13951396      What the agent should produce. Copied from the input event.13971398    - `max_iterations: number or null`13991400      Evaluate-then-revise cycles before giving up. Default 3, max 20.14011402      format: int3214031404    - `outcome_id: string`14051406      Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.14071408    - `processed_at: string`14091410      A timestamp in RFC 3339 format14111412      format: date-time14131414    - `rubric: BetaManagedAgentsFileRubric or BetaManagedAgentsTextRubric`14151416      Rubric for grading the quality of an outcome.14171418      - `BetaManagedAgentsFileRubric object`14191420        Rubric referenced by a file uploaded via the Files API.14211422        - `type: "file"`14231424        - `file_id: string`14251426          ID of the rubric file.14271428      - `BetaManagedAgentsTextRubric object`14291430        Rubric content provided inline as text.14311432        - `type: "text"`14331434        - `content: string`14351436          Rubric content. Plain text or markdown — the grader treats it as freeform text.14371438  - `BetaManagedAgentsSessionDeletedEvent object`14391440    Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.14411442    - `type: "session.deleted"`14431444    - `id: string`14451446      Unique identifier for this event.14471448    - `processed_at: string`14491450      A timestamp in RFC 3339 format14511452      format: date-time14531454  - `BetaManagedAgentsSessionThreadStatusRunningEvent object`14551456    A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.14571458    - `type: "session.thread_status_running"`14591460    - `id: string`14611462      Unique identifier for this event.14631464    - `agent_name: string`14651466      Name of the agent the thread runs.14671468    - `processed_at: string`14691470      A timestamp in RFC 3339 format14711472      format: date-time14731474    - `session_thread_id: string`14751476      Public sthr_ ID of the thread that started running.14771478  - `BetaManagedAgentsSessionThreadStatusIdleEvent object`14791480    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.14811482    - `type: "session.thread_status_idle"`14831484    - `id: string`14851486      Unique identifier for this event.14871488    - `agent_name: string`14891490      Name of the agent the thread runs.14911492    - `processed_at: string`14931494      A timestamp in RFC 3339 format14951496      format: date-time14971498    - `session_thread_id: string`14991500      Public sthr_ ID of the thread that went idle.15011502    - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted or BetaManagedAgentsSessionBudgetReached`15031504      - `BetaManagedAgentsSessionEndTurn object`15051506        The agent completed its turn naturally and is ready for the next user message.15071508      - `BetaManagedAgentsSessionRequiresAction object`15091510        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.15111512      - `BetaManagedAgentsSessionRetriesExhausted object`15131514        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.15151516      - `BetaManagedAgentsSessionBudgetReached object`15171518        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.15191520  - `BetaManagedAgentsSessionThreadStatusTerminatedEvent object`15211522    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.15231524    - `type: "session.thread_status_terminated"`15251526    - `id: string`15271528      Unique identifier for this event.15291530    - `agent_name: string`15311532      Name of the agent the thread runs.15331534    - `processed_at: string`15351536      A timestamp in RFC 3339 format15371538      format: date-time15391540    - `session_thread_id: string`15411542      Public sthr_ ID of the thread that terminated.15431544  - `BetaManagedAgentsUserToolResultEvent object`15451546    Event sent by the client 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.15471548    - `type: "user.tool_result"`15491550    - `id: string`15511552      Unique identifier for this event.15531554    - `tool_use_id: string`15551556      The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.15571558    - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsSearchResultBlock`15591560      The result content returned by the tool.15611562      - `BetaManagedAgentsTextBlock object`15631564        Regular text content.15651566      - `BetaManagedAgentsImageBlock object`15671568        Image content specified directly as base64 data or as a reference via a URL.15691570      - `BetaManagedAgentsDocumentBlock object`15711572        Document content, either specified directly as base64 data, as text, or as a reference via a URL.15731574      - `BetaManagedAgentsSearchResultBlock object`15751576        A block containing a web search result.15771578    - `is_error: optional boolean or null`15791580      Whether the tool execution resulted in an error.15811582    - `processed_at: optional string or null`15831584      A timestamp in RFC 3339 format15851586      format: date-time15871588    - `session_thread_id: optional string or null`15891590      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.15911592  - `BetaManagedAgentsSessionThreadStatusRescheduledEvent object`15931594    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.15951596    - `type: "session.thread_status_rescheduled"`15971598    - `id: string`15991600      Unique identifier for this event.16011602    - `agent_name: string`16031604      Name of the agent the thread runs.16051606    - `processed_at: string`16071608      A timestamp in RFC 3339 format16091610      format: date-time16111612    - `session_thread_id: string`16131614      Public sthr_ ID of the thread that is retrying.16151616  - `BetaManagedAgentsSessionUpdatedEvent object`16171618    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.16191620    - `type: "session.updated"`16211622    - `id: string`16231624      Unique identifier for this event.16251626    - `processed_at: string`16271628      A timestamp in RFC 3339 format16291630      format: date-time16311632    - `agent: optional BetaManagedAgentsSessionAgent or null`16331634      Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.16351636      - `type: "agent"`16371638      - `id: string`16391640      - `description: string or null`16411642      - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`16431644        - `type: "url"`16451646        - `name: string`16471648        - `url: string`16491650      - `model: BetaManagedAgentsModelConfig`16511652        Model identifier and configuration.16531654        - `id: BetaManagedAgentsModel`16551656          The model that will power your agent.16571658          See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.16591660          - `"claude-fable-5-1" or "claude-sonnet-5" or "claude-fable-5" or 11 more`16611662            The model that will power your agent.16631664            See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.16651666            - `"claude-fable-5-1"`16671668              Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows16691670            - `"claude-sonnet-5"`16711672              High-performance model for coding and agents16731674            - `"claude-fable-5"`16751676              Next generation of intelligence for the hardest knowledge work and coding problems16771678            - `"claude-opus-5"`16791680              Powerful intelligence for long-running agents and coding16811682            - `"claude-opus-4-8"`16831684              Powerful intelligence for long-running agents and coding16851686            - `"claude-opus-4-7"`16871688              Powerful intelligence for long-running agents and coding16891690            - `"claude-opus-4-6"`16911692              Powerful intelligence for long-running agents and coding16931694            - `"claude-sonnet-4-6"`16951696              Best combination of speed and intelligence16971698            - `"claude-haiku-4-5"`16991700              Fastest model with near-frontier intelligence17011702            - `"claude-haiku-4-5-20251001"`17031704              Fastest model with near-frontier intelligence17051706            - `"claude-opus-4-5"`17071708              Powerful intelligence for long-running agents and coding17091710            - `"claude-opus-4-5-20251101"`17111712              Powerful intelligence for long-running agents and coding17131714            - `"claude-sonnet-4-5"`17151716              High-performance model for agents and coding17171718            - `"claude-sonnet-4-5-20250929"`17191720              High-performance model for agents and coding17211722          - `string`17231724        - `effort: optional BetaManagedAgentsEffortLow or BetaManagedAgentsEffortMedium or BetaManagedAgentsEffortHigh or 2 more`17251726          How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes.17271728          - `BetaManagedAgentsEffortLow object`17291730            Low effort. Favors latency over reasoning depth.17311732            - `type: "low"`17331734          - `BetaManagedAgentsEffortMedium object`17351736            Medium effort. Balances latency and reasoning depth.17371738            - `type: "medium"`17391740          - `BetaManagedAgentsEffortHigh object`17411742            High effort. Favors reasoning depth.17431744            - `type: "high"`17451746          - `BetaManagedAgentsEffortXhigh object`17471748            Extra-high effort. Not all models accept this level.17491750            - `type: "xhigh"`17511752          - `BetaManagedAgentsEffortMax object`17531754            Maximum effort. Favors reasoning depth over latency.17551756            - `type: "max"`17571758        - `inference_geo: optional string`17591760          Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.17611762        - `speed: optional "standard" or "fast"`17631764          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.17651766          - `"standard"`17671768          - `"fast"`17691770      - `multiagent: BetaManagedAgentsSessionMultiagentCoordinator or null`17711772        Resolved coordinator topology with full agent definitions for each roster member.17731774        - `type: "coordinator"`17751776        - `agents: array of BetaManagedAgentsSessionThreadAgent or BetaManagedAgentsAdvisor`17771778          Full `agent` definitions the coordinator may spawn as session threads.17791780          - `BetaManagedAgentsSessionThreadAgent object`17811782            Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.17831784            - `type: "agent"`17851786            - `id: string`17871788            - `description: string or null`17891790            - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`17911792              - `type: "url"`17931794              - `name: string`17951796              - `url: string`17971798            - `model: BetaManagedAgentsModelConfig`17991800              Model identifier and configuration.18011802            - `name: string`18031804            - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`18051806              - `BetaManagedAgentsAnthropicSkill object`18071808                A resolved Anthropic-managed skill.18091810                - `type: "anthropic"`18111812                - `skill_id: string`18131814                - `version: string`18151816              - `BetaManagedAgentsCustomSkill object`18171818                A resolved user-created custom skill.18191820                - `type: "custom"`18211822                - `skill_id: string`18231824                - `version: string`18251826            - `system: string or null`18271828            - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`18291830              - `BetaManagedAgentsAgentToolset20260401 object`18311832                - `type: "agent_toolset_20260401"`18331834                - `configs: array of BetaManagedAgentsAgentToolConfig`18351836                  - `BetaManagedAgentsBashToolConfig object`18371838                    Configuration for the bash tool.18391840                    - `type: "bash"`18411842                    - `enabled: boolean`18431844                    - `name: "bash"`18451846                    - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`18471848                      Permission policy for tool execution.18491850                      - `BetaManagedAgentsAlwaysAllowPolicy object`18511852                        Tool calls are automatically approved without user confirmation.18531854                        - `type: "always_allow"`18551856                      - `BetaManagedAgentsAlwaysAskPolicy object`18571858                        Tool calls require user confirmation before execution.18591860                        - `type: "always_ask"`18611862                      - `BetaManagedAgentsAutoPolicy object`18631864                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.18651866                        - `type: "auto"`18671868                  - `BetaManagedAgentsEditToolConfig object`18691870                    Configuration for the edit tool.18711872                    - `type: "edit"`18731874                    - `enabled: boolean`18751876                    - `name: "edit"`18771878                    - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`18791880                      Permission policy for tool execution.18811882                      - `BetaManagedAgentsAlwaysAllowPolicy object`18831884                        Tool calls are automatically approved without user confirmation.18851886                      - `BetaManagedAgentsAlwaysAskPolicy object`18871888                        Tool calls require user confirmation before execution.18891890                      - `BetaManagedAgentsAutoPolicy object`18911892                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.18931894                  - `BetaManagedAgentsReadToolConfig object`18951896                    Configuration for the read tool.18971898                    - `type: "read"`18991900                    - `enabled: boolean`19011902                    - `name: "read"`19031904                    - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`19051906                      Permission policy for tool execution.19071908                      - `BetaManagedAgentsAlwaysAllowPolicy object`19091910                        Tool calls are automatically approved without user confirmation.19111912                      - `BetaManagedAgentsAlwaysAskPolicy object`19131914                        Tool calls require user confirmation before execution.19151916                      - `BetaManagedAgentsAutoPolicy object`19171918                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.19191920                  - `BetaManagedAgentsWriteToolConfig object`19211922                    Configuration for the write tool.19231924                    - `type: "write"`19251926                    - `enabled: boolean`19271928                    - `name: "write"`19291930                    - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`19311932                      Permission policy for tool execution.19331934                      - `BetaManagedAgentsAlwaysAllowPolicy object`19351936                        Tool calls are automatically approved without user confirmation.19371938                      - `BetaManagedAgentsAlwaysAskPolicy object`19391940                        Tool calls require user confirmation before execution.19411942                      - `BetaManagedAgentsAutoPolicy object`19431944                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.19451946                  - `BetaManagedAgentsGlobToolConfig object`19471948                    Configuration for the glob tool.19491950                    - `type: "glob"`19511952                    - `enabled: boolean`19531954                    - `name: "glob"`19551956                    - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`19571958                      Permission policy for tool execution.19591960                      - `BetaManagedAgentsAlwaysAllowPolicy object`19611962                        Tool calls are automatically approved without user confirmation.19631964                      - `BetaManagedAgentsAlwaysAskPolicy object`19651966                        Tool calls require user confirmation before execution.19671968                      - `BetaManagedAgentsAutoPolicy object`19691970                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.19711972                  - `BetaManagedAgentsGrepToolConfig object`19731974                    Configuration for the grep tool.19751976                    - `type: "grep"`19771978                    - `enabled: boolean`19791980                    - `name: "grep"`19811982                    - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`19831984                      Permission policy for tool execution.19851986                      - `BetaManagedAgentsAlwaysAllowPolicy object`19871988                        Tool calls are automatically approved without user confirmation.19891990                      - `BetaManagedAgentsAlwaysAskPolicy object`19911992                        Tool calls require user confirmation before execution.19931994                      - `BetaManagedAgentsAutoPolicy object`19951996                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.19971998                  - `BetaManagedAgentsWebFetchToolConfig object`19992000                    Configuration for the web_fetch tool.20012002                    - `type: "web_fetch"`20032004                    - `enabled: boolean`20052006                    - `name: "web_fetch"`20072008                    - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`20092010                      Permission policy for tool execution.20112012                      - `BetaManagedAgentsAlwaysAllowPolicy object`20132014                        Tool calls are automatically approved without user confirmation.20152016                      - `BetaManagedAgentsAlwaysAskPolicy object`20172018                        Tool calls require user confirmation before execution.20192020                      - `BetaManagedAgentsAutoPolicy object`20212022                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.20232024                    - `allowed_domains: optional array of string`20252026                    - `blocked_domains: optional array of string`20272028                    - `max_content_tokens: optional number or null`20292030                      format: int3220312032                  - `BetaManagedAgentsWebSearchToolConfig object`20332034                    Configuration for the web_search tool.20352036                    - `type: "web_search"`20372038                    - `enabled: boolean`20392040                    - `name: "web_search"`20412042                    - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`20432044                      Permission policy for tool execution.20452046                      - `BetaManagedAgentsAlwaysAllowPolicy object`20472048                        Tool calls are automatically approved without user confirmation.20492050                      - `BetaManagedAgentsAlwaysAskPolicy object`20512052                        Tool calls require user confirmation before execution.20532054                      - `BetaManagedAgentsAutoPolicy object`20552056                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.20572058                    - `allowed_domains: optional array of string`20592060                    - `blocked_domains: optional array of string`20612062                    - `user_location: optional BetaManagedAgentsUserLocation or null`20632064                      Approximate user location for search result localization.20652066                      - `type: "approximate"`20672068                        Location precision. Only "approximate" is supported.20692070                      - `city: optional string or null`20712072                        City name.20732074                        minLength: 1, maxLength: 25520752076                      - `country: optional string or null`20772078                        Two-letter ISO 3166-1 country code, uppercase.20792080                      - `region: optional string or null`20812082                        Region or state name.20832084                        minLength: 1, maxLength: 25520852086                      - `timezone: optional string or null`20872088                        IANA timezone identifier, e.g. "America/Los_Angeles".20892090                        minLength: 1, maxLength: 25520912092                - `default_config: BetaManagedAgentsAgentToolsetDefaultConfig`20932094                  Resolved default configuration for agent tools.20952096                  - `enabled: boolean`20972098                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`20992100                    Permission policy for tool execution.21012102                    - `BetaManagedAgentsAlwaysAllowPolicy object`21032104                      Tool calls are automatically approved without user confirmation.21052106                    - `BetaManagedAgentsAlwaysAskPolicy object`21072108                      Tool calls require user confirmation before execution.21092110                    - `BetaManagedAgentsAutoPolicy object`21112112                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.21132114              - `BetaManagedAgentsMCPToolset object`21152116                - `type: "mcp_toolset"`21172118                - `configs: array of BetaManagedAgentsMCPToolConfig`21192120                  - `enabled: boolean`21212122                  - `name: string`21232124                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`21252126                    Permission policy for tool execution.21272128                    - `BetaManagedAgentsAlwaysAllowPolicy object`21292130                      Tool calls are automatically approved without user confirmation.21312132                    - `BetaManagedAgentsAlwaysAskPolicy object`21332134                      Tool calls require user confirmation before execution.21352136                    - `BetaManagedAgentsAutoPolicy object`21372138                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.21392140                - `default_config: BetaManagedAgentsMCPToolsetDefaultConfig`21412142                  Resolved default configuration for all tools from an MCP server.21432144                  - `enabled: boolean`21452146                  - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or BetaManagedAgentsAutoPolicy`21472148                    Permission policy for tool execution.21492150                    - `BetaManagedAgentsAlwaysAllowPolicy object`21512152                      Tool calls are automatically approved without user confirmation.21532154                    - `BetaManagedAgentsAlwaysAskPolicy object`21552156                      Tool calls require user confirmation before execution.21572158                    - `BetaManagedAgentsAutoPolicy object`21592160                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.21612162                - `mcp_server_name: string`21632164              - `BetaManagedAgentsCustomTool object`21652166                A custom tool as returned in API responses.21672168                - `type: "custom"`21692170                - `description: string`21712172                - `input_schema: BetaManagedAgentsCustomToolInputSchema`21732174                  JSON Schema for custom tool input parameters.21752176                  - `type: "object"`21772178                  - `properties: optional map[unknown] or null`21792180                  - `required: optional array of string or null`21812182                - `name: string`21832184            - `version: number`21852186              format: int3221872188          - `BetaManagedAgentsAdvisor object`21892190            Platform advisor roster entry: a model the session's primary thread may consult mid-turn.21912192            - `type: "advisor"`21932194            - `model: string`21952196              The advisor model id.21972198      - `name: string`21992200      - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`22012202        - `BetaManagedAgentsAnthropicSkill object`22032204          A resolved Anthropic-managed skill.22052206        - `BetaManagedAgentsCustomSkill object`22072208          A resolved user-created custom skill.22092210      - `system: string or null`22112212      - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`22132214        - `BetaManagedAgentsAgentToolset20260401 object`22152216        - `BetaManagedAgentsMCPToolset object`22172218        - `BetaManagedAgentsCustomTool object`22192220          A custom tool as returned in API responses.22212222      - `version: number`22232224        format: int3222252226    - `budget: optional BetaManagedAgentsBudgetLimit or null`22272228      A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.22292230      - `type: "limit"`22312232      - `max_list_cost: BetaMonetaryAmount`22332234        A monetary amount in a specific currency.22352236        - `amount: string`22372238          Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.22392240        - `currency: BetaCurrency`22412242          Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.22432244    - `metadata: optional map[string]`22452246      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.22472248    - `title: optional string or null`22492250      The session's new title. Present only when the update changed it.22512252  - `BetaManagedAgentsStartEvent object`22532254    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.22552256    - `type: "event_start"`22572258    - `event: BetaManagedAgentsStartEventPreview`22592260      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.22612262      - `BetaManagedAgentsAgentMessagePreview object`22632264        - `type: "agent.message"`22652266        - `id: string`22672268          The id the buffered agent.message will carry if it is emitted. Matches the event_id on this preview's event_delta events.22692270      - `BetaManagedAgentsAgentThinkingPreview object`22712272        - `type: "agent.thinking"`22732274        - `id: string`22752276          The id the buffered agent.thinking will carry if it is emitted. Start-only — no event_delta events follow.22772278  - `BetaManagedAgentsDeltaEvent object`22792280    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.22812282    - `type: "event_delta"`22832284    - `delta: BetaManagedAgentsDeltaContent`22852286      One fragment of the previewed event. The delta type is named for the previewed event's field it streams into: agent.message events stream content_delta fragments, each a partial element of the content array.22872288      - `type: "content_delta"`22892290      - `content: BetaManagedAgentsTextBlock`22912292        Regular text content.22932294      - `index: optional number`22952296        Which entry in the previewed event's content array this fragment lands in. Insert content as that entry when the index is new; append to the existing entry otherwise.22972298        format: uint3222992300    - `event_id: string`23012302      The id of the event being previewed. Matches event.id on the corresponding event_start and the buffered event that reconciles the preview.23032304  - `BetaManagedAgentsSystemMessageEvent object`23052306    A mid-conversation system message event. Carries system-role content that is appended to the session as a `role: "system"` turn.23072308    - `type: "system.message"`23092310    - `id: string`23112312      Unique identifier for this event.23132314    - `content: array of BetaManagedAgentsSystemContentBlock`23152316      System content blocks. Text-only.23172318      - `type: "text"`23192320      - `text: string`23212322        The text content.23232324        minLength: 123252326    - `processed_at: optional string or null`23272328      A timestamp in RFC 3339 format23292330      format: date-time23312332  - `BetaManagedAgentsSessionUsageEvent object`23332334    Periodic snapshot of the session's cumulative usage and tracked list cost.23352336    - `type: "session.usage"`23372338    - `id: string`23392340      Unique identifier for this event.23412342    - `processed_at: string`23432344      A timestamp in RFC 3339 format23452346      format: date-time23472348    - `usage: BetaManagedAgentsSessionUsageSnapshot`23492350      Point-in-time snapshot of a session's cumulative usage.23512352      - `active_seconds: optional number`23532354        Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once. This is the duration the session's runtime cost is priced on.23552356        format: double23572358      - `cache_creation: optional BetaManagedAgentsCacheCreationUsage`23592360        Prompt-cache creation token usage broken down by cache lifetime.23612362        - `ephemeral_1h_input_tokens: optional number`23632364          Tokens used to create 1-hour ephemeral cache entries.23652366          format: int3223672368        - `ephemeral_5m_input_tokens: optional number`23692370          Tokens used to create 5-minute ephemeral cache entries.23712372          format: int3223732374      - `cache_read_input_tokens: optional number`23752376        Total tokens read from prompt cache.23772378        format: int3223792380      - `input_tokens: optional number`23812382        Total input tokens consumed across all turns.23832384        format: int3223852386      - `list_cost: optional BetaMonetaryAmount`23872388        A monetary amount in a specific currency.23892390      - `output_tokens: optional number`23912392        Total output tokens generated across all turns.23932394        format: int3223952396      - `server_tool_use: optional BetaManagedAgentsServerToolUsage`23972398        Cumulative count of server-executed tool invocations, broken down by tool.23992400        - `web_fetch_requests: optional number`24012402          Number of server-executed web fetch requests.24032404          format: int3224052406        - `web_search_requests: optional number`24072408          Number of server-executed web search requests.24092410          format: int3224112412    - `budget: optional BetaManagedAgentsBudgetLimit or null`24132414      A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.24152416## Example24172418```bash2419curl https://api.anthropic.com/v1/sessions/$SESSION_ID/threads/$THREAD_ID/stream \2420    -H 'anthropic-version: 2023-06-01' \2421    -H 'anthropic-beta: managed-agents-2026-04-01' \2422    -H "X-Api-Key: $ANTHROPIC_API_KEY"2423```24242425### Response (200)24262427```json2428{2429  "id": "sevt_011CZkZGOp0iBcp4kaQSihUmy",2430  "content": [2431    {2432      "text": "Where is my order #1234?",2433      "type": "text"2434    }2435  ],2436  "type": "user.message",2437  "processed_at": "2026-03-15T10:00:00Z"2438}2439```2440
Files main
Menu

Theme