\ No newline at end of file
+# Beta
+
+## Domain Types
+
+### Beta API Error
+
+- `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+### Beta Authentication Error
+
+- `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+### Beta Billing Error
+
+- `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+### Beta Error
+
+- `beta_error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+### Beta Error Response
+
+- `beta_error_response: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+### Beta Gateway Timeout Error
+
+- `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+### Beta Invalid Request Error
+
+- `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+### Beta Not Found Error
+
+- `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+### Beta Overloaded Error
+
+- `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+### Beta Permission Error
+
+- `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+### Beta Rate Limit Error
+
+- `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+# Models
+
+## List
+
+`$ ant beta:models list`
+
+**get** `/v1/models`
+
+List available models.
+
+The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListResponse_ModelInfo_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of BetaModelInfo`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant beta:models list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:models retrieve`
+
+**get** `/v1/models/{model_id}`
+
+Get a specific model.
+
+The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
+
+### Parameters
+
+- `--model-id: string`
+
+ Model identifier or alias.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_model_info: object { id, capabilities, created_at, 4 more }`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+### Example
+
+```cli
+ant beta:models retrieve \
+ --api-key my-anthropic-api-key \
+ --model-id model_id
+```
+
+## Domain Types
+
+### Beta Capability Support
+
+- `beta_capability_support: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Context Management Capability
+
+- `beta_context_management_capability: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management capability details.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Effort Capability
+
+- `beta_effort_capability: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) capability details.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Model Capabilities
+
+- `beta_model_capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Model Info
+
+- `beta_model_info: object { id, capabilities, created_at, 4 more }`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+### Beta Thinking Capability
+
+- `beta_thinking_capability: object { supported, types }`
+
+ Thinking capability details.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Thinking Types
+
+- `beta_thinking_types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+# Messages
+
+## Create
+
+`$ ant beta:messages create`
+
+**post** `/v1/messages`
+
+Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
+
+The Messages API can be used for either single queries or stateless multi-turn conversations.
+
+Learn more about the Messages API in our [user guide](https://docs.claude.com/en/docs/initial-setup)
+
+### Parameters
+
+- `--max-tokens: number`
+
+ Body param: The maximum number of tokens to generate before stopping.
+
+ Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
+
+ Different models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details.
+
+- `--message: array of BetaMessageParam`
+
+ Body param: Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ Body param: The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Body param: Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--container: optional BetaContainerParams or string`
+
+ Body param: Container identifier for reuse across requests.
+
+- `--context-management: optional object { edits }`
+
+ Body param: Context management configuration.
+
+ This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.
+
+- `--inference-geo: optional string`
+
+ Body param: Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.
+
+- `--mcp-server: optional array of BetaRequestMCPServerURLDefinition`
+
+ Body param: MCP servers to be utilized in this request
+
+- `--metadata: optional object { user_id }`
+
+ Body param: An object describing metadata about the request.
+
+- `--output-config: optional object { effort, format }`
+
+ Body param: Configuration options for the model's output, such as the output format.
+
+- `--output-format: optional object { schema, type }`
+
+ Body param: Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
+
+- `--service-tier: optional "auto" or "standard_only"`
+
+ Body param: Determines whether to use priority capacity (if available) or standard capacity for this request.
+
+ Anthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
+
+- `--speed: optional "standard" or "fast"`
+
+ Body param: The inference speed mode for this request. `"fast"` enables high output-tokens-per-second inference.
+
+- `--stop-sequence: optional array of string`
+
+ Body param: Custom text sequences that will cause the model to stop generating.
+
+ Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
+
+ If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.
+
+- `--system: optional string or array of BetaTextBlockParam`
+
+ Body param: System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--temperature: optional number`
+
+ Body param: Amount of randomness injected into the response.
+
+ Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
+
+ Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
+
+- `--thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive`
+
+ Body param: Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional BetaToolChoiceAuto or BetaToolChoiceAny or BetaToolChoiceTool or BetaToolChoiceNone`
+
+ Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of BetaToolUnion`
+
+ Body param: Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+- `--top-k: optional number`
+
+ Body param: Only sample from the top K options for each subsequent token.
+
+ Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--top-p: optional number`
+
+ Body param: Use nucleus sampling.
+
+ In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Example
+
+```cli
+ant beta:messages create \
+ --api-key my-anthropic-api-key \
+ --max-tokens 1024 \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-opus-4-6
+```
+
+## Count Tokens
+
+`$ ant beta:messages count-tokens`
+
+**post** `/v1/messages/count_tokens`
+
+Count the number of tokens in a Message.
+
+The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.
+
+Learn more about token counting in our [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
+
+### Parameters
+
+- `--message: array of BetaMessageParam`
+
+ Body param: Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ Body param: The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Body param: Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--context-management: optional object { edits }`
+
+ Body param: Context management configuration.
+
+ This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.
+
+- `--mcp-server: optional array of BetaRequestMCPServerURLDefinition`
+
+ Body param: MCP servers to be utilized in this request
+
+- `--output-config: optional object { effort, format }`
+
+ Body param: Configuration options for the model's output, such as the output format.
+
+- `--output-format: optional object { schema, type }`
+
+ Body param: Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
+
+- `--speed: optional "standard" or "fast"`
+
+ Body param: The inference speed mode for this request. `"fast"` enables high output-tokens-per-second inference.
+
+- `--system: optional string or array of BetaTextBlockParam`
+
+ Body param: System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive`
+
+ Body param: Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional BetaToolChoiceAuto or BetaToolChoiceAny or BetaToolChoiceTool or BetaToolChoiceNone`
+
+ Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of BetaTool or BetaToolBash20241022 or BetaToolBash20250124 or 19 more`
+
+ Body param: Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_tokens_count: object { context_management, input_tokens }`
+
+ - `context_management: object { original_input_tokens }`
+
+ Information about context management applied to the message.
+
+ - `original_input_tokens: number`
+
+ The original token count before context management was applied
+
+ - `input_tokens: number`
+
+ The total number of tokens across the provided list of messages, system prompt, and tools.
+
+### Example
+
+```cli
+ant beta:messages count-tokens \
+ --api-key my-anthropic-api-key \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-mythos-preview
+```
+
+## Domain Types
+
+### Beta All Thinking Turns
+
+- `beta_all_thinking_turns: object { type }`
+
+ - `type: "all"`
+
+### Beta Base64 Image Source
+
+- `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+### Beta Base64 PDF Source
+
+- `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+### Beta Bash Code Execution Output Block
+
+- `beta_bash_code_execution_output_block: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+### Beta Bash Code Execution Output Block Param
+
+- `beta_bash_code_execution_output_block_param: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+### Beta Bash Code Execution Result Block
+
+- `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+### Beta Bash Code Execution Result Block Param
+
+- `beta_bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+### Beta Bash Code Execution Tool Result Block
+
+- `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+### Beta Bash Code Execution Tool Result Block Param
+
+- `beta_bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
+
+ - `beta_bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Bash Code Execution Tool Result Error
+
+- `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+### Beta Bash Code Execution Tool Result Error Param
+
+- `beta_bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+### Beta Cache Control Ephemeral
+
+- `beta_cache_control_ephemeral: object { type, ttl }`
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Cache Creation
+
+- `beta_cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+### Beta Citation Char Location
+
+- `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+### Beta Citation Char Location Param
+
+- `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+### Beta Citation Config
+
+- `beta_citation_config: object { enabled }`
+
+ - `enabled: boolean`
+
+### Beta Citation Content Block Location
+
+- `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+### Beta Citation Content Block Location Param
+
+- `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+### Beta Citation Page Location
+
+- `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+### Beta Citation Page Location Param
+
+- `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+### Beta Citation Search Result Location
+
+- `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Citation Search Result Location Param
+
+- `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Citation Web Search Result Location Param
+
+- `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+### Beta Citations Config Param
+
+- `beta_citations_config_param: object { enabled }`
+
+ - `enabled: optional boolean`
+
+### Beta Citations Delta
+
+- `beta_citations_delta: object { citation, type }`
+
+ - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+### Beta Citations Web Search Result Location
+
+- `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+### Beta Clear Thinking 20251015 Edit
+
+- `beta_clear_thinking_20251015_edit: object { type, keep }`
+
+ - `type: "clear_thinking_20251015"`
+
+ - `keep: optional BetaThinkingTurns or BetaAllThinkingTurns or "all"`
+
+ Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
+
+ - `beta_thinking_turns: object { type, value }`
+
+ - `type: "thinking_turns"`
+
+ - `value: number`
+
+ - `beta_all_thinking_turns: object { type }`
+
+ - `type: "all"`
+
+ - `union_member_2: "all"`
+
+### Beta Clear Thinking 20251015 Edit Response
+
+- `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+### Beta Clear Tool Uses 20250919 Edit
+
+- `beta_clear_tool_uses_20250919_edit: object { type, clear_at_least, clear_tool_inputs, 3 more }`
+
+ - `type: "clear_tool_uses_20250919"`
+
+ - `clear_at_least: optional object { type, value }`
+
+ Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+ - `clear_tool_inputs: optional boolean or array of string`
+
+ Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
+
+ - `union_member_0: boolean`
+
+ - `union_member_1: array of string`
+
+ - `exclude_tools: optional array of string`
+
+ Tool names whose uses are preserved from clearing
+
+ - `keep: optional object { type, value }`
+
+ Number of tool uses to retain in the conversation
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+ - `trigger: optional BetaInputTokensTrigger or BetaToolUsesTrigger`
+
+ Condition that triggers the context management strategy
+
+ - `beta_input_tokens_trigger: object { type, value }`
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+ - `beta_tool_uses_trigger: object { type, value }`
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+### Beta Clear Tool Uses 20250919 Edit Response
+
+- `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+### Beta Code Execution Output Block
+
+- `beta_code_execution_output_block: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+### Beta Code Execution Output Block Param
+
+- `beta_code_execution_output_block_param: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+### Beta Code Execution Result Block
+
+- `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+### Beta Code Execution Result Block Param
+
+- `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+### Beta Code Execution Tool 20250522
+
+- `beta_code_execution_tool_20250522: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250522"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Code Execution Tool 20250825
+
+- `beta_code_execution_tool_20250825: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250825"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Code Execution Tool 20260120
+
+- `beta_code_execution_tool_20260120: object { name, type, allowed_callers, 3 more }`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20260120"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Code Execution Tool Result Block
+
+- `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+### Beta Code Execution Tool Result Block Content
+
+- `beta_code_execution_tool_result_block_content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Beta Code Execution Tool Result Block Param
+
+- `beta_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaCodeExecutionToolResultErrorParam or BetaCodeExecutionResultBlockParam or BetaEncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Code Execution Tool Result Block Param Content
+
+- `beta_code_execution_tool_result_block_param_content: BetaCodeExecutionToolResultErrorParam or BetaCodeExecutionResultBlockParam or BetaEncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Beta Code Execution Tool Result Error
+
+- `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+### Beta Code Execution Tool Result Error Code
+
+- `beta_code_execution_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+### Beta Code Execution Tool Result Error Param
+
+- `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+### Beta Compact 20260112 Edit
+
+- `beta_compact_20260112_edit: object { type, instructions, pause_after_compaction, trigger }`
+
+ Automatically compact older context when reaching the configured trigger threshold.
+
+ - `type: "compact_20260112"`
+
+ - `instructions: optional string`
+
+ Additional instructions for summarization.
+
+ - `pause_after_compaction: optional boolean`
+
+ Whether to pause after compaction and return the compaction block to the user.
+
+ - `trigger: optional object { type, value }`
+
+ When to trigger compaction. Defaults to 150000 input tokens.
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+### Beta Compaction Block
+
+- `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+### Beta Compaction Block Param
+
+- `beta_compaction_block_param: object { content, type, cache_control }`
+
+ A compaction block containing summary of previous context.
+
+ Users should round-trip these blocks from responses to subsequent requests
+ to maintain context across compaction boundaries.
+
+ When content is None, the block represents a failed compaction. The server
+ treats these as no-ops. Empty string content is not allowed.
+
+ - `content: string`
+
+ Summary of previously compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Compaction Content Block Delta
+
+- `beta_compaction_content_block_delta: object { content, type }`
+
+ - `content: string`
+
+ - `type: "compaction_delta"`
+
+### Beta Compaction Iteration Usage
+
+- `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+### Beta Container
+
+- `beta_container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+### Beta Container Params
+
+- `beta_container_params: object { id, skills }`
+
+ Container parameters with skills to be loaded.
+
+ - `id: optional string`
+
+ Container id
+
+ - `skills: optional array of BetaSkillParams`
+
+ List of skills to load in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: optional string`
+
+ Skill version or 'latest' for most recent version
+
+### Beta Container Upload Block
+
+- `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+### Beta Container Upload Block Param
+
+- `beta_container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Content Block
+
+- `beta_content_block: BetaTextBlock or BetaThinkingBlock or BetaRedactedThinkingBlock or 12 more`
+
+ Response model for a file uploaded to the container.
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+### Beta Content Block Param
+
+- `beta_content_block_param: BetaTextBlockParam or BetaImageBlockParam or BetaRequestDocumentBlock or 16 more`
+
+ Regular text content.
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 2 more`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+ - `beta_server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of BetaWebSearchResultBlockParam or BetaWebSearchToolRequestError`
+
+ - `Result Block: array of BetaWebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
+
+ - `beta_web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaCodeExecutionToolResultErrorParam or BetaCodeExecutionResultBlockParam or BetaEncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
+
+ - `beta_bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `beta_text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `beta_text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `beta_text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
+
+ - `beta_tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_mcp_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_request_mcp_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional string or array of BetaTextBlockParam`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_param_content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `is_error: optional boolean`
+
+ - `beta_container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_compaction_block_param: object { content, type, cache_control }`
+
+ A compaction block containing summary of previous context.
+
+ Users should round-trip these blocks from responses to subsequent requests
+ to maintain context across compaction boundaries.
+
+ When content is None, the block represents a failed compaction. The server
+ treats these as no-ops. Empty string content is not allowed.
+
+ - `content: string`
+
+ Summary of previously compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Content Block Source
+
+- `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+### Beta Content Block Source Content
+
+- `beta_content_block_source_content: BetaTextBlockParam or BetaImageBlockParam`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Context Management Config
+
+- `beta_context_management_config: object { edits }`
+
+ - `edits: optional array of BetaClearToolUses20250919Edit or BetaClearThinking20251015Edit or BetaCompact20260112Edit`
+
+ List of context management edits to apply
+
+ - `beta_clear_tool_uses_20250919_edit: object { type, clear_at_least, clear_tool_inputs, 3 more }`
+
+ - `type: "clear_tool_uses_20250919"`
+
+ - `clear_at_least: optional object { type, value }`
+
+ Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+ - `clear_tool_inputs: optional boolean or array of string`
+
+ Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
+
+ - `union_member_0: boolean`
+
+ - `union_member_1: array of string`
+
+ - `exclude_tools: optional array of string`
+
+ Tool names whose uses are preserved from clearing
+
+ - `keep: optional object { type, value }`
+
+ Number of tool uses to retain in the conversation
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+ - `trigger: optional BetaInputTokensTrigger or BetaToolUsesTrigger`
+
+ Condition that triggers the context management strategy
+
+ - `beta_input_tokens_trigger: object { type, value }`
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+ - `beta_tool_uses_trigger: object { type, value }`
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+ - `beta_clear_thinking_20251015_edit: object { type, keep }`
+
+ - `type: "clear_thinking_20251015"`
+
+ - `keep: optional BetaThinkingTurns or BetaAllThinkingTurns or "all"`
+
+ Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
+
+ - `beta_thinking_turns: object { type, value }`
+
+ - `type: "thinking_turns"`
+
+ - `value: number`
+
+ - `beta_all_thinking_turns: object { type }`
+
+ - `type: "all"`
+
+ - `union_member_2: "all"`
+
+ - `beta_compact_20260112_edit: object { type, instructions, pause_after_compaction, trigger }`
+
+ Automatically compact older context when reaching the configured trigger threshold.
+
+ - `type: "compact_20260112"`
+
+ - `instructions: optional string`
+
+ Additional instructions for summarization.
+
+ - `pause_after_compaction: optional boolean`
+
+ Whether to pause after compaction and return the compaction block to the user.
+
+ - `trigger: optional object { type, value }`
+
+ When to trigger compaction. Defaults to 150000 input tokens.
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+### Beta Context Management Response
+
+- `beta_context_management_response: object { applied_edits }`
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+### Beta Count Tokens Context Management Response
+
+- `beta_count_tokens_context_management_response: object { original_input_tokens }`
+
+ - `original_input_tokens: number`
+
+ The original token count before context management was applied
+
+### Beta Direct Caller
+
+- `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+### Beta Document Block
+
+- `beta_document_block: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+### Beta Encrypted Code Execution Result Block
+
+- `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Beta Encrypted Code Execution Result Block Param
+
+- `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Beta File Document Source
+
+- `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+### Beta File Image Source
+
+- `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+### Beta Image Block Param
+
+- `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Input JSON Delta
+
+- `beta_input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+### Beta Input Tokens Clear At Least
+
+- `beta_input_tokens_clear_at_least: object { type, value }`
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+### Beta Input Tokens Trigger
+
+- `beta_input_tokens_trigger: object { type, value }`
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+### Beta Iterations Usage
+
+- `beta_iterations_usage: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+### Beta JSON Output Format
+
+- `beta_json_output_format: object { schema, type }`
+
+ - `schema: map[unknown]`
+
+ The JSON schema of the format
+
+ - `type: "json_schema"`
+
+### Beta MCP Tool Config
+
+- `beta_mcp_tool_config: object { defer_loading, enabled }`
+
+ Configuration for a specific tool in an MCP toolset.
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+### Beta MCP Tool Default Config
+
+- `beta_mcp_tool_default_config: object { defer_loading, enabled }`
+
+ Default configuration for tools in an MCP toolset.
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+### Beta MCP Tool Result Block
+
+- `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+### Beta MCP Tool Use Block
+
+- `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+### Beta MCP Tool Use Block Param
+
+- `beta_mcp_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta MCP Toolset
+
+- `beta_mcp_toolset: object { mcp_server_name, type, cache_control, 2 more }`
+
+ Configuration for a group of tools from an MCP server.
+
+ Allows configuring enabled status and defer_loading for all tools
+ from an MCP server, with optional per-tool overrides.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server to configure tools for
+
+ - `type: "mcp_toolset"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `configs: optional map[BetaMCPToolConfig]`
+
+ Configuration overrides for specific tools, keyed by tool name
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+ - `default_config: optional object { defer_loading, enabled }`
+
+ Default configuration applied to all tools from this server
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+### Beta Memory Tool 20250818
+
+- `beta_memory_tool_20250818: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "memory"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "memory_20250818"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Memory Tool 20250818 Command
+
+- `beta_memory_tool_20250818_command: BetaMemoryTool20250818ViewCommand or BetaMemoryTool20250818CreateCommand or BetaMemoryTool20250818StrReplaceCommand or 3 more`
+
+ - `beta_memory_tool_20250818_view_command: object { command, path, view_range }`
+
+ - `command: "view"`
+
+ Command type identifier
+
+ - `path: string`
+
+ Path to directory or file to view
+
+ - `view_range: optional array of number`
+
+ Optional line range for viewing specific lines
+
+ - `beta_memory_tool_20250818_create_command: object { command, file_text, path }`
+
+ - `command: "create"`
+
+ Command type identifier
+
+ - `file_text: string`
+
+ Content to write to the file
+
+ - `path: string`
+
+ Path where the file should be created
+
+ - `beta_memory_tool_20250818_str_replace_command: object { command, new_str, old_str, path }`
+
+ - `command: "str_replace"`
+
+ Command type identifier
+
+ - `new_str: string`
+
+ Text to replace with
+
+ - `old_str: string`
+
+ Text to search for and replace
+
+ - `path: string`
+
+ Path to the file where text should be replaced
+
+ - `beta_memory_tool_20250818_insert_command: object { command, insert_line, insert_text, path }`
+
+ - `command: "insert"`
+
+ Command type identifier
+
+ - `insert_line: number`
+
+ Line number where text should be inserted
+
+ - `insert_text: string`
+
+ Text to insert at the specified line
+
+ - `path: string`
+
+ Path to the file where text should be inserted
+
+ - `beta_memory_tool_20250818_delete_command: object { command, path }`
+
+ - `command: "delete"`
+
+ Command type identifier
+
+ - `path: string`
+
+ Path to the file or directory to delete
+
+ - `beta_memory_tool_20250818_rename_command: object { command, new_path, old_path }`
+
+ - `command: "rename"`
+
+ Command type identifier
+
+ - `new_path: string`
+
+ New path for the file or directory
+
+ - `old_path: string`
+
+ Current path of the file or directory
+
+### Beta Memory Tool 20250818 Create Command
+
+- `beta_memory_tool_20250818_create_command: object { command, file_text, path }`
+
+ - `command: "create"`
+
+ Command type identifier
+
+ - `file_text: string`
+
+ Content to write to the file
+
+ - `path: string`
+
+ Path where the file should be created
+
+### Beta Memory Tool 20250818 Delete Command
+
+- `beta_memory_tool_20250818_delete_command: object { command, path }`
+
+ - `command: "delete"`
+
+ Command type identifier
+
+ - `path: string`
+
+ Path to the file or directory to delete
+
+### Beta Memory Tool 20250818 Insert Command
+
+- `beta_memory_tool_20250818_insert_command: object { command, insert_line, insert_text, path }`
+
+ - `command: "insert"`
+
+ Command type identifier
+
+ - `insert_line: number`
+
+ Line number where text should be inserted
+
+ - `insert_text: string`
+
+ Text to insert at the specified line
+
+ - `path: string`
+
+ Path to the file where text should be inserted
+
+### Beta Memory Tool 20250818 Rename Command
+
+- `beta_memory_tool_20250818_rename_command: object { command, new_path, old_path }`
+
+ - `command: "rename"`
+
+ Command type identifier
+
+ - `new_path: string`
+
+ New path for the file or directory
+
+ - `old_path: string`
+
+ Current path of the file or directory
+
+### Beta Memory Tool 20250818 Str Replace Command
+
+- `beta_memory_tool_20250818_str_replace_command: object { command, new_str, old_str, path }`
+
+ - `command: "str_replace"`
+
+ Command type identifier
+
+ - `new_str: string`
+
+ Text to replace with
+
+ - `old_str: string`
+
+ Text to search for and replace
+
+ - `path: string`
+
+ Path to the file where text should be replaced
+
+### Beta Memory Tool 20250818 View Command
+
+- `beta_memory_tool_20250818_view_command: object { command, path, view_range }`
+
+ - `command: "view"`
+
+ Command type identifier
+
+ - `path: string`
+
+ Path to directory or file to view
+
+ - `view_range: optional array of number`
+
+ Optional line range for viewing specific lines
+
+### Beta Message
+
+- `beta_message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Message Delta Usage
+
+- `beta_message_delta_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 3 more }`
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Beta Message Iteration Usage
+
+- `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+### Beta Message Param
+
+- `beta_message_param: object { content, role }`
+
+ - `content: array of BetaContentBlockParam`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 2 more`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+ - `beta_server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of BetaWebSearchResultBlockParam or BetaWebSearchToolRequestError`
+
+ - `Result Block: array of BetaWebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
+
+ - `beta_web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaCodeExecutionToolResultErrorParam or BetaCodeExecutionResultBlockParam or BetaEncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
+
+ - `beta_bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `beta_text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `beta_text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `beta_text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
+
+ - `beta_tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_mcp_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_request_mcp_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional string or array of BetaTextBlockParam`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_param_content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `is_error: optional boolean`
+
+ - `beta_container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_compaction_block_param: object { content, type, cache_control }`
+
+ A compaction block containing summary of previous context.
+
+ Users should round-trip these blocks from responses to subsequent requests
+ to maintain context across compaction boundaries.
+
+ When content is None, the block represents a failed compaction. The server
+ treats these as no-ops. Empty string content is not allowed.
+
+ - `content: string`
+
+ Summary of previously compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `role: "user" or "assistant"`
+
+ - `"user"`
+
+ - `"assistant"`
+
+### Beta Message Tokens Count
+
+- `beta_message_tokens_count: object { context_management, input_tokens }`
+
+ - `context_management: object { original_input_tokens }`
+
+ Information about context management applied to the message.
+
+ - `original_input_tokens: number`
+
+ The original token count before context management was applied
+
+ - `input_tokens: number`
+
+ The total number of tokens across the provided list of messages, system prompt, and tools.
+
+### Beta Metadata
+
+- `beta_metadata: object { user_id }`
+
+ - `user_id: optional string`
+
+ An external identifier for the user who is associated with the request.
+
+ This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
+
+### Beta Output Config
+
+- `beta_output_config: object { effort, format }`
+
+ - `effort: optional "low" or "medium" or "high" or "max"`
+
+ All possible effort levels.
+
+ - `"low"`
+
+ - `"medium"`
+
+ - `"high"`
+
+ - `"max"`
+
+ - `format: optional object { schema, type }`
+
+ A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ - `schema: map[unknown]`
+
+ The JSON schema of the format
+
+ - `type: "json_schema"`
+
+### Beta Plain Text Source
+
+- `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+### Beta Raw Content Block Delta
+
+- `beta_raw_content_block_delta: BetaTextDelta or BetaInputJSONDelta or BetaCitationsDelta or 3 more`
+
+ - `beta_text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `beta_input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `beta_citations_delta: object { citation, type }`
+
+ - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `beta_thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `beta_signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+ - `beta_compaction_content_block_delta: object { content, type }`
+
+ - `content: string`
+
+ - `type: "compaction_delta"`
+
+### Beta Raw Content Block Delta Event
+
+- `beta_raw_content_block_delta_event: object { delta, index, type }`
+
+ - `delta: BetaTextDelta or BetaInputJSONDelta or BetaCitationsDelta or 3 more`
+
+ - `beta_text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `beta_input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `beta_citations_delta: object { citation, type }`
+
+ - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `beta_thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `beta_signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+ - `beta_compaction_content_block_delta: object { content, type }`
+
+ - `content: string`
+
+ - `type: "compaction_delta"`
+
+ - `index: number`
+
+ - `type: "content_block_delta"`
+
+### Beta Raw Content Block Start Event
+
+- `beta_raw_content_block_start_event: object { content_block, index, type }`
+
+ - `content_block: BetaTextBlock or BetaThinkingBlock or BetaRedactedThinkingBlock or 12 more`
+
+ Response model for a file uploaded to the container.
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `index: number`
+
+ - `type: "content_block_start"`
+
+### Beta Raw Content Block Stop Event
+
+- `beta_raw_content_block_stop_event: object { index, type }`
+
+ - `index: number`
+
+ - `type: "content_block_stop"`
+
+### Beta Raw Message Delta Event
+
+- `beta_raw_message_delta_event: object { context_management, delta, type, usage }`
+
+ - `context_management: object { applied_edits }`
+
+ Information about context management strategies applied during the request
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `delta: object { container, stop_details, stop_reason, stop_sequence }`
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ - `type: "message_delta"`
+
+ - `usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 3 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Beta Raw Message Start Event
+
+- `beta_raw_message_start_event: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "message_start"`
+
+### Beta Raw Message Stop Event
+
+- `beta_raw_message_stop_event: object { type }`
+
+ - `type: "message_stop"`
+
+### Beta Raw Message Stream Event
+
+- `beta_raw_message_stream_event: BetaRawMessageStartEvent or BetaRawMessageDeltaEvent or BetaRawMessageStopEvent or 3 more`
+
+ - `beta_raw_message_start_event: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "message_start"`
+
+ - `beta_raw_message_delta_event: object { context_management, delta, type, usage }`
+
+ - `context_management: object { applied_edits }`
+
+ Information about context management strategies applied during the request
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `delta: object { container, stop_details, stop_reason, stop_sequence }`
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ - `type: "message_delta"`
+
+ - `usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 3 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `beta_raw_message_stop_event: object { type }`
+
+ - `type: "message_stop"`
+
+ - `beta_raw_content_block_start_event: object { content_block, index, type }`
+
+ - `content_block: BetaTextBlock or BetaThinkingBlock or BetaRedactedThinkingBlock or 12 more`
+
+ Response model for a file uploaded to the container.
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `index: number`
+
+ - `type: "content_block_start"`
+
+ - `beta_raw_content_block_delta_event: object { delta, index, type }`
+
+ - `delta: BetaTextDelta or BetaInputJSONDelta or BetaCitationsDelta or 3 more`
+
+ - `beta_text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `beta_input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `beta_citations_delta: object { citation, type }`
+
+ - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `beta_thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `beta_signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+ - `beta_compaction_content_block_delta: object { content, type }`
+
+ - `content: string`
+
+ - `type: "compaction_delta"`
+
+ - `index: number`
+
+ - `type: "content_block_delta"`
+
+ - `beta_raw_content_block_stop_event: object { index, type }`
+
+ - `index: number`
+
+ - `type: "content_block_stop"`
+
+### Beta Redacted Thinking Block
+
+- `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+### Beta Redacted Thinking Block Param
+
+- `beta_redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+### Beta Refusal Stop Details
+
+- `beta_refusal_stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+### Beta Request Document Block
+
+- `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+### Beta Request MCP Server Tool Configuration
+
+- `beta_request_mcp_server_tool_configuration: object { allowed_tools, enabled }`
+
+ - `allowed_tools: optional array of string`
+
+ - `enabled: optional boolean`
+
+### Beta Request MCP Server URL Definition
+
+- `beta_request_mcp_server_url_definition: object { name, type, url, 2 more }`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `authorization_token: optional string`
+
+ - `tool_configuration: optional object { allowed_tools, enabled }`
+
+ - `allowed_tools: optional array of string`
+
+ - `enabled: optional boolean`
+
+### Beta Request MCP Tool Result Block Param
+
+- `beta_request_mcp_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional string or array of BetaTextBlockParam`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_param_content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `is_error: optional boolean`
+
+### Beta Search Result Block Param
+
+- `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+### Beta Server Tool Caller
+
+- `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+### Beta Server Tool Caller 20260120
+
+- `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Server Tool Usage
+
+- `beta_server_tool_usage: object { web_fetch_requests, web_search_requests }`
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Beta Server Tool Use Block
+
+- `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Server Tool Use Block Param
+
+- `beta_server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Signature Delta
+
+- `beta_signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+### Beta Skill
+
+- `beta_skill: object { skill_id, type, version }`
+
+ A skill that was loaded in a container (response model).
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+### Beta Skill Params
+
+- `beta_skill_params: object { skill_id, type, version }`
+
+ Specification for a skill to be loaded in a container (request model).
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: optional string`
+
+ Skill version or 'latest' for most recent version
+
+### Beta Stop Reason
+
+- `beta_stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+### Beta Text Block
+
+- `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+### Beta Text Block Param
+
+- `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Text Citation
+
+- `beta_text_citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Text Citation Param
+
+- `beta_text_citation_param: BetaCitationCharLocationParam or BetaCitationPageLocationParam or BetaCitationContentBlockLocationParam or 2 more`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Text Delta
+
+- `beta_text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+### Beta Text Editor Code Execution Create Result Block
+
+- `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+### Beta Text Editor Code Execution Create Result Block Param
+
+- `beta_text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+### Beta Text Editor Code Execution Str Replace Result Block
+
+- `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+### Beta Text Editor Code Execution Str Replace Result Block Param
+
+- `beta_text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+### Beta Text Editor Code Execution Tool Result Block
+
+- `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+### Beta Text Editor Code Execution Tool Result Block Param
+
+- `beta_text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `beta_text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `beta_text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `beta_text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Text Editor Code Execution Tool Result Error
+
+- `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+### Beta Text Editor Code Execution Tool Result Error Param
+
+- `beta_text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+### Beta Text Editor Code Execution View Result Block
+
+- `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+### Beta Text Editor Code Execution View Result Block Param
+
+- `beta_text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+### Beta Thinking Block
+
+- `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+### Beta Thinking Block Param
+
+- `beta_thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+### Beta Thinking Config Adaptive
+
+- `beta_thinking_config_adaptive: object { type, display }`
+
+ - `type: "adaptive"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Beta Thinking Config Disabled
+
+- `beta_thinking_config_disabled: object { type }`
+
+ - `type: "disabled"`
+
+### Beta Thinking Config Enabled
+
+- `beta_thinking_config_enabled: object { budget_tokens, type, display }`
+
+ - `budget_tokens: number`
+
+ Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
+
+ Must be ≥1024 and less than `max_tokens`.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `type: "enabled"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Beta Thinking Config Param
+
+- `beta_thinking_config_param: BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive`
+
+ Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `beta_thinking_config_enabled: object { budget_tokens, type, display }`
+
+ - `budget_tokens: number`
+
+ Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
+
+ Must be ≥1024 and less than `max_tokens`.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `type: "enabled"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+ - `beta_thinking_config_disabled: object { type }`
+
+ - `type: "disabled"`
+
+ - `beta_thinking_config_adaptive: object { type, display }`
+
+ - `type: "adaptive"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Beta Thinking Delta
+
+- `beta_thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+### Beta Thinking Turns
+
+- `beta_thinking_turns: object { type, value }`
+
+ - `type: "thinking_turns"`
+
+ - `value: number`
+
+### Beta Tool
+
+- `beta_tool: object { input_schema, name, allowed_callers, 7 more }`
+
+ - `input_schema: object { type, properties, required }`
+
+ [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
+
+ This defines the shape of the `input` that your tool accepts and that the model will produce.
+
+ - `type: "object"`
+
+ - `properties: optional map[unknown]`
+
+ - `required: optional array of string`
+
+ - `name: string`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `description: optional string`
+
+ Description of what this tool does.
+
+ Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
+
+ - `eager_input_streaming: optional boolean`
+
+ Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `type: optional "custom"`
+
+ - `"custom"`
+
+### Beta Tool Bash 20241022
+
+- `beta_tool_bash_20241022: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Bash 20250124
+
+- `beta_tool_bash_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Choice
+
+- `beta_tool_choice: BetaToolChoiceAuto or BetaToolChoiceAny or BetaToolChoiceTool or BetaToolChoiceNone`
+
+ How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+ - `beta_tool_choice_auto: object { type, disable_parallel_tool_use }`
+
+ The model will automatically decide whether to use tools.
+
+ - `type: "auto"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output at most one tool use.
+
+ - `beta_tool_choice_any: object { type, disable_parallel_tool_use }`
+
+ The model will use any available tools.
+
+ - `type: "any"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+ - `beta_tool_choice_tool: object { name, type, disable_parallel_tool_use }`
+
+ The model will use the specified tool with `tool_choice.name`.
+
+ - `name: string`
+
+ The name of the tool to use.
+
+ - `type: "tool"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+ - `beta_tool_choice_none: object { type }`
+
+ The model will not be allowed to use tools.
+
+ - `type: "none"`
+
+### Beta Tool Choice Any
+
+- `beta_tool_choice_any: object { type, disable_parallel_tool_use }`
+
+ The model will use any available tools.
+
+ - `type: "any"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+### Beta Tool Choice Auto
+
+- `beta_tool_choice_auto: object { type, disable_parallel_tool_use }`
+
+ The model will automatically decide whether to use tools.
+
+ - `type: "auto"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output at most one tool use.
+
+### Beta Tool Choice None
+
+- `beta_tool_choice_none: object { type }`
+
+ The model will not be allowed to use tools.
+
+ - `type: "none"`
+
+### Beta Tool Choice Tool
+
+- `beta_tool_choice_tool: object { name, type, disable_parallel_tool_use }`
+
+ The model will use the specified tool with `tool_choice.name`.
+
+ - `name: string`
+
+ The name of the tool to use.
+
+ - `type: "tool"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+### Beta Tool Computer Use 20241022
+
+- `beta_tool_computer_use_20241022: object { display_height_px, display_width_px, name, 7 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Computer Use 20250124
+
+- `beta_tool_computer_use_20250124: object { display_height_px, display_width_px, name, 7 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Computer Use 20251124
+
+- `beta_tool_computer_use_20251124: object { display_height_px, display_width_px, name, 8 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20251124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `enable_zoom: optional boolean`
+
+ Whether to enable an action to take a zoomed-in screenshot of the screen.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Reference Block
+
+- `beta_tool_reference_block: object { tool_name, type }`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+### Beta Tool Reference Block Param
+
+- `beta_tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Tool Result Block Param
+
+- `beta_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 2 more`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+### Beta Tool Search Tool Bm25 20251119
+
+- `beta_tool_search_tool_bm25_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_bm25"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
+
+ - `"tool_search_tool_bm25_20251119"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Search Tool Regex 20251119
+
+- `beta_tool_search_tool_regex_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_regex"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
+
+ - `"tool_search_tool_regex_20251119"`
+
+ - `"tool_search_tool_regex"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Search Tool Result Block
+
+- `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+### Beta Tool Search Tool Result Block Param
+
+- `beta_tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
+
+ - `beta_tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Tool Search Tool Result Error
+
+- `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+### Beta Tool Search Tool Result Error Param
+
+- `beta_tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+### Beta Tool Search Tool Search Result Block
+
+- `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+### Beta Tool Search Tool Search Result Block Param
+
+- `beta_tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+### Beta Tool Text Editor 20241022
+
+- `beta_tool_text_editor_20241022: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Text Editor 20250124
+
+- `beta_tool_text_editor_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Text Editor 20250429
+
+- `beta_tool_text_editor_20250429: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250429"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Text Editor 20250728
+
+- `beta_tool_text_editor_20250728: object { name, type, allowed_callers, 5 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250728"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `max_characters: optional number`
+
+ Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Union
+
+- `beta_tool_union: BetaTool or BetaToolBash20241022 or BetaToolBash20250124 or 19 more`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `beta_tool: object { input_schema, name, allowed_callers, 7 more }`
+
+ - `input_schema: object { type, properties, required }`
+
+ [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
+
+ This defines the shape of the `input` that your tool accepts and that the model will produce.
+
+ - `type: "object"`
+
+ - `properties: optional map[unknown]`
+
+ - `required: optional array of string`
+
+ - `name: string`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `description: optional string`
+
+ Description of what this tool does.
+
+ Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
+
+ - `eager_input_streaming: optional boolean`
+
+ Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `type: optional "custom"`
+
+ - `"custom"`
+
+ - `beta_tool_bash_20241022: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_bash_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_code_execution_tool_20250522: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250522"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_code_execution_tool_20250825: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250825"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_code_execution_tool_20260120: object { name, type, allowed_callers, 3 more }`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20260120"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_computer_use_20241022: object { display_height_px, display_width_px, name, 7 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_memory_tool_20250818: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "memory"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "memory_20250818"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_computer_use_20250124: object { display_height_px, display_width_px, name, 7 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_text_editor_20241022: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_computer_use_20251124: object { display_height_px, display_width_px, name, 8 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20251124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `enable_zoom: optional boolean`
+
+ Whether to enable an action to take a zoomed-in screenshot of the screen.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_text_editor_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_text_editor_20250429: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250429"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_text_editor_20250728: object { name, type, allowed_callers, 5 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250728"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `max_characters: optional number`
+
+ Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_web_search_tool_20250305: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20250305"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+ - `beta_web_fetch_tool_20250910: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20250910"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_web_search_tool_20260209: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+ - `beta_web_fetch_tool_20260209: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_web_fetch_tool_20260309: object { name, type, allowed_callers, 9 more }`
+
+ Web fetch tool with use_cache parameter for bypassing cached content.
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260309"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `use_cache: optional boolean`
+
+ Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
+
+ - `beta_tool_search_tool_bm25_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_bm25"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
+
+ - `"tool_search_tool_bm25_20251119"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_search_tool_regex_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_regex"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
+
+ - `"tool_search_tool_regex_20251119"`
+
+ - `"tool_search_tool_regex"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_mcp_toolset: object { mcp_server_name, type, cache_control, 2 more }`
+
+ Configuration for a group of tools from an MCP server.
+
+ Allows configuring enabled status and defer_loading for all tools
+ from an MCP server, with optional per-tool overrides.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server to configure tools for
+
+ - `type: "mcp_toolset"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `configs: optional map[BetaMCPToolConfig]`
+
+ Configuration overrides for specific tools, keyed by tool name
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+ - `default_config: optional object { defer_loading, enabled }`
+
+ Default configuration applied to all tools from this server
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+### Beta Tool Use Block
+
+- `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Tool Use Block Param
+
+- `beta_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Tool Uses Keep
+
+- `beta_tool_uses_keep: object { type, value }`
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+### Beta Tool Uses Trigger
+
+- `beta_tool_uses_trigger: object { type, value }`
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+### Beta URL Image Source
+
+- `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+### Beta URL PDF Source
+
+- `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+### Beta Usage
+
+- `beta_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta User Location
+
+- `beta_user_location: object { type, city, country, 2 more }`
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Beta Web Fetch Block
+
+- `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+### Beta Web Fetch Block Param
+
+- `beta_web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+### Beta Web Fetch Tool 20250910
+
+- `beta_web_fetch_tool_20250910: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20250910"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Web Fetch Tool 20260209
+
+- `beta_web_fetch_tool_20260209: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Web Fetch Tool 20260309
+
+- `beta_web_fetch_tool_20260309: object { name, type, allowed_callers, 9 more }`
+
+ Web fetch tool with use_cache parameter for bypassing cached content.
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260309"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `use_cache: optional boolean`
+
+ Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
+
+### Beta Web Fetch Tool Result Block
+
+- `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Web Fetch Tool Result Block Param
+
+- `beta_web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
+
+ - `beta_web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Web Fetch Tool Result Error Block
+
+- `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+### Beta Web Fetch Tool Result Error Block Param
+
+- `beta_web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+### Beta Web Fetch Tool Result Error Code
+
+- `beta_web_fetch_tool_result_error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+### Beta Web Search Result Block
+
+- `beta_web_search_result_block: object { encrypted_content, page_age, title, 2 more }`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+### Beta Web Search Result Block Param
+
+- `beta_web_search_result_block_param: object { encrypted_content, title, type, 2 more }`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+### Beta Web Search Tool 20250305
+
+- `beta_web_search_tool_20250305: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20250305"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Beta Web Search Tool 20260209
+
+- `beta_web_search_tool_20260209: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Beta Web Search Tool Request Error
+
+- `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Beta Web Search Tool Result Block
+
+- `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Web Search Tool Result Block Content
+
+- `beta_web_search_tool_result_block_content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+### Beta Web Search Tool Result Block Param
+
+- `beta_web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of BetaWebSearchResultBlockParam or BetaWebSearchToolRequestError`
+
+ - `Result Block: array of BetaWebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Web Search Tool Result Block Param Content
+
+- `beta_web_search_tool_result_block_param_content: array of BetaWebSearchResultBlockParam or BetaWebSearchToolRequestError`
+
+ - `Result Block: array of BetaWebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Beta Web Search Tool Result Error
+
+- `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Beta Web Search Tool Result Error Code
+
+- `beta_web_search_tool_result_error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+# Batches
+
+## Create
+
+`$ ant beta:messages:batches create`
+
+**post** `/v1/messages/batches`
+
+Send a batch of Message creation requests.
+
+The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--request: array of object { custom_id, params }`
+
+ Body param: List of requests for prompt completion. Each is an individual request to create a Message.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches create \
+ --api-key my-anthropic-api-key \
+ --request '{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text}], role: user}], model: claude-opus-4-6}}'
+```
+
+## Retrieve
+
+`$ ant beta:messages:batches retrieve`
+
+**get** `/v1/messages/batches/{message_batch_id}`
+
+This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches retrieve \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## List
+
+`$ ant beta:messages:batches list`
+
+**get** `/v1/messages/batches`
+
+List all Message Batches within a Workspace. Most recently created batches are returned first.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListResponse_MessageBatch_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of BetaMessageBatch`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant beta:messages:batches list \
+ --api-key my-anthropic-api-key
+```
+
+## Cancel
+
+`$ ant beta:messages:batches cancel`
+
+**post** `/v1/messages/batches/{message_batch_id}/cancel`
+
+Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
+
+The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches cancel \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Delete
+
+`$ ant beta:messages:batches delete`
+
+**delete** `/v1/messages/batches/{message_batch_id}`
+
+Delete a Message Batch.
+
+Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Example
+
+```cli
+ant beta:messages:batches delete \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Results
+
+`$ ant beta:messages:batches results`
+
+**get** `/v1/messages/batches/{message_batch_id}/results`
+
+Streams the results of a Message Batch as a `.jsonl` file.
+
+Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Example
+
+```cli
+ant beta:messages:batches results \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Domain Types
+
+### Beta Deleted Message Batch
+
+- `beta_deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Beta Message Batch
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Beta Message Batch Canceled Result
+
+- `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+### Beta Message Batch Errored Result
+
+- `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+### Beta Message Batch Expired Result
+
+- `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Individual Response
+
+- `beta_message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Request Counts
+
+- `beta_message_batch_request_counts: object { canceled, errored, expired, 2 more }`
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+### Beta Message Batch Result
+
+- `beta_message_batch_result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Succeeded Result
+
+- `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+# Agents
+
+## Create
+
+`$ ant beta:agents create`
+
+**post** `/v1/agents`
+
+Create Agent
+
+### Parameters
+
+- `--model: BetaManagedAgentsModelConfigParams`
+
+ Body param: Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison), e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration control
+
+- `--name: string`
+
+ Body param: Human-readable name for the agent. 1-256 characters.
+
+- `--description: optional string`
+
+ Body param: Description of what the agent does. Up to 2048 characters.
+
+- `--mcp-server: optional array of BetaManagedAgentsURLMCPServerParams`
+
+ Body param: MCP servers this agent connects to. Maximum 20. Names must be unique within the array.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
+
+- `--skill: optional array of BetaManagedAgentsSkillParams`
+
+ Body param: Skills available to the agent. Maximum 20.
+
+- `--system: optional string`
+
+ Body param: System prompt for the agent. Up to 100,000 characters.
+
+- `--tool: optional array of BetaManagedAgentsAgentToolset20260401Params or BetaManagedAgentsMCPToolsetParams or BetaManagedAgentsCustomToolParams`
+
+ Body param: Tool configurations available to the agent. Maximum of 128 tools across all toolsets allowed.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents create \
+ --api-key my-anthropic-api-key \
+ --model '{id: claude-opus-4-6}' \
+ --name 'My First Agent'
+```
+
+## List
+
+`$ ant beta:agents list`
+
+**get** `/v1/agents`
+
+List Agents
+
+### Parameters
+
+- `--created-at-gte: optional string`
+
+ Query param: Return agents created at or after this time (inclusive).
+
+- `--created-at-lte: optional string`
+
+ Query param: Return agents created at or before this time (inclusive).
+
+- `--include-archived: optional boolean`
+
+ Query param: Include archived agents in results. Defaults to false.
+
+- `--limit: optional number`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListAgents: object { data, next_page }`
+
+ Paginated list of agents.
+
+ - `data: optional array of BetaManagedAgentsAgent`
+
+ List of agents.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:agents list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:agents retrieve`
+
+**get** `/v1/agents/{agent_id}`
+
+Get Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--version: optional number`
+
+ Query param: Agent version. Omit for the most recent version. Must be at least 1 if specified.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents retrieve \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
+
+## Update
+
+`$ ant beta:agents update`
+
+**post** `/v1/agents/{agent_id}`
+
+Update Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--version: number`
+
+ Body param: The agent's current version, used to prevent concurrent overwrites. Obtain this value from a create or retrieve response. The request fails if this does not match the server's current version.
+
+- `--description: optional string`
+
+ Body param: Description. Up to 2048 characters. Omit to preserve; send empty string or null to clear.
+
+- `--mcp-server: optional array of BetaManagedAgentsURLMCPServerParams`
+
+ Body param: MCP servers. Full replacement. Omit to preserve; send empty array or null to clear. Names must be unique. Maximum 20.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.
+
+- `--model: optional BetaManagedAgentsModelConfigParams`
+
+ Body param: Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison), e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration control. Omit to preserve. Cannot be cleared.
+
+- `--name: optional string`
+
+ Body param: Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.
+
+- `--skill: optional array of BetaManagedAgentsSkillParams`
+
+ Body param: Skills. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 20.
+
+- `--system: optional string`
+
+ Body param: System prompt. Up to 100,000 characters. Omit to preserve; send empty string or null to clear.
+
+- `--tool: optional array of BetaManagedAgentsAgentToolset20260401Params or BetaManagedAgentsMCPToolsetParams or BetaManagedAgentsCustomToolParams`
+
+ Body param: Tool configurations available to the agent. Full replacement. Omit to preserve; send empty array or null to clear. Maximum of 128 tools across all toolsets allowed.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents update \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP \
+ --version 1
+```
+
+## Archive
+
+`$ ant beta:agents archive`
+
+**post** `/v1/agents/{agent_id}/archive`
+
+Archive Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path parameter agent_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents archive \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
+
+## Domain Types
+
+### Beta Managed Agents Agent
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Beta Managed Agents Agent Tool Config
+
+- `beta_managed_agents_agent_tool_config: object { enabled, name, permission_policy }`
+
+ Configuration for a specific agent tool.
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Agent Tool Config Params
+
+- `beta_managed_agents_agent_tool_config_params: object { name, enabled, permission_policy }`
+
+ Configuration override for a specific tool within a toolset.
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `enabled: optional boolean`
+
+ Whether this tool is enabled and available to Claude. Overrides the default_config setting.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Agent Toolset Default Config
+
+- `beta_managed_agents_agent_toolset_default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Agent Toolset Default Config Params
+
+- `beta_managed_agents_agent_toolset_default_config_params: object { enabled, permission_policy }`
+
+ Default configuration for all tools in a toolset.
+
+ - `enabled: optional boolean`
+
+ Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Agent Toolset20260401
+
+- `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+### Beta Managed Agents Agent Toolset20260401 Params
+
+- `beta_managed_agents_agent_toolset20260401_params: object { type, configs, default_config }`
+
+ Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `configs: optional array of BetaManagedAgentsAgentToolConfigParams`
+
+ Per-tool configuration overrides.
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `enabled: optional boolean`
+
+ Whether this tool is enabled and available to Claude. Overrides the default_config setting.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: optional object { enabled, permission_policy }`
+
+ Default configuration for all tools in a toolset.
+
+ - `enabled: optional boolean`
+
+ Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Always Allow Policy
+
+- `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+### Beta Managed Agents Always Ask Policy
+
+- `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Anthropic Skill
+
+- `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+### Beta Managed Agents Anthropic Skill Params
+
+- `beta_managed_agents_anthropic_skill_params: object { skill_id, type, version }`
+
+ An Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ Identifier of the Anthropic skill (e.g., "xlsx").
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: optional string`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents Custom Skill
+
+- `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+### Beta Managed Agents Custom Skill Params
+
+- `beta_managed_agents_custom_skill_params: object { skill_id, type, version }`
+
+ A user-created custom skill.
+
+ - `skill_id: string`
+
+ Tagged ID of the custom skill (e.g., "skill_01XJ5...").
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: optional string`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents Custom Tool
+
+- `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+### Beta Managed Agents Custom Tool Input Schema
+
+- `beta_managed_agents_custom_tool_input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+### Beta Managed Agents Custom Tool Params
+
+- `beta_managed_agents_custom_tool_params: object { description, input_schema, name, type }`
+
+ A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.
+
+ - `description: string`
+
+ Description of what the tool does, shown to the agent to help it decide when to use the tool. 1-1024 characters.
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+### Beta Managed Agents MCP Server URL Definition
+
+- `beta_managed_agents_mcp_server_url_definition: object { name, type, url }`
+
+ URL-based MCP server connection as returned in API responses.
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+### Beta Managed Agents MCP Tool Config
+
+- `beta_managed_agents_mcp_tool_config: object { enabled, name, permission_policy }`
+
+ Resolved configuration for a specific MCP tool.
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents MCP Tool Config Params
+
+- `beta_managed_agents_mcp_tool_config_params: object { name, enabled, permission_policy }`
+
+ Configuration override for a specific MCP tool.
+
+ - `name: string`
+
+ Name of the MCP tool to configure. 1-128 characters.
+
+ - `enabled: optional boolean`
+
+ Whether this tool is enabled. Overrides the `default_config` setting.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents MCP Toolset
+
+- `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+### Beta Managed Agents MCP Toolset Default Config
+
+- `beta_managed_agents_mcp_toolset_default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents MCP Toolset Default Config Params
+
+- `beta_managed_agents_mcp_toolset_default_config_params: object { enabled, permission_policy }`
+
+ Default configuration for all tools from an MCP server.
+
+ - `enabled: optional boolean`
+
+ Whether tools are enabled by default. Defaults to true if not specified.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents MCP Toolset Params
+
+- `beta_managed_agents_mcp_toolset_params: object { mcp_server_name, type, configs, default_config }`
+
+ Configuration for tools from an MCP server defined in `mcp_servers`.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `configs: optional array of BetaManagedAgentsMCPToolConfigParams`
+
+ Per-tool configuration overrides.
+
+ - `name: string`
+
+ Name of the MCP tool to configure. 1-128 characters.
+
+ - `enabled: optional boolean`
+
+ Whether this tool is enabled. Overrides the `default_config` setting.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: optional object { enabled, permission_policy }`
+
+ Default configuration for all tools from an MCP server.
+
+ - `enabled: optional boolean`
+
+ Whether tools are enabled by default. Defaults to true if not specified.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Model Config
+
+- `beta_managed_agents_model_config: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Managed Agents Model Config Params
+
+- `beta_managed_agents_model_config_params: object { id, speed }`
+
+ An object that defines additional configuration control over model use
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Managed Agents Skill Params
+
+- `beta_managed_agents_skill_params: BetaManagedAgentsAnthropicSkillParams or BetaManagedAgentsCustomSkillParams`
+
+ Skill to load in the session container.
+
+ - `beta_managed_agents_anthropic_skill_params: object { skill_id, type, version }`
+
+ An Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ Identifier of the Anthropic skill (e.g., "xlsx").
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: optional string`
+
+ Version to pin. Defaults to latest if omitted.
+
+ - `beta_managed_agents_custom_skill_params: object { skill_id, type, version }`
+
+ A user-created custom skill.
+
+ - `skill_id: string`
+
+ Tagged ID of the custom skill (e.g., "skill_01XJ5...").
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: optional string`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents URL MCP Server Params
+
+- `beta_managed_agents_url_mcp_server_params: object { name, type, url }`
+
+ URL-based MCP server connection.
+
+ - `name: string`
+
+ Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ Endpoint URL for the MCP server.
+
+# Versions
+
+## List
+
+`$ ant beta:agents:versions list`
+
+**get** `/v1/agents/{agent_id}/versions`
+
+List Agent Versions
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--limit: optional number`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListAgentVersions: object { data, next_page }`
+
+ Paginated list of agent versions.
+
+ - `data: optional array of BetaManagedAgentsAgent`
+
+ Agent versions.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:agents:versions list \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
+
+# Environments
+
+## Create
+
+`$ ant beta:environments create`
+
+**post** `/v1/environments`
+
+Create a new environment with the specified configuration.
+
+### Parameters
+
+- `--name: string`
+
+ Body param: Human-readable name for the environment
+
+- `--config: optional object { type, networking, packages }`
+
+ Body param: Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+- `--description: optional string`
+
+ Body param: Optional description of the environment
+
+- `--metadata: optional map[string]`
+
+ Body param: User-provided metadata key-value pairs
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments create \
+ --api-key my-anthropic-api-key \
+ --name python-data-analysis
+```
+
+## List
+
+`$ ant beta:environments list`
+
+**get** `/v1/environments`
+
+List environments with pagination support.
+
+### Parameters
+
+- `--include-archived: optional boolean`
+
+ Query param: Include archived environments in the response
+
+- `--limit: optional number`
+
+ Query param: Maximum number of environments to return
+
+- `--page: optional string`
+
+ Query param: Opaque cursor from previous response for pagination. Pass the `next_page` value from the previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaEnvironmentListResponse: object { data, next_page }`
+
+ Response when listing environments.
+
+ This response model uses opaque cursor-based pagination. Use the `page`
+ query parameter with the value from `next_page` to fetch the next page.
+
+ - `data: array of BetaEnvironment`
+
+ List of environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+ - `next_page: string`
+
+ Token for fetching the next page of results. If `null`, there are no more results available. Pass this value to the `page` parameter in the next request.
+
+### Example
+
+```cli
+ant beta:environments list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:environments retrieve`
+
+**get** `/v1/environments/{environment_id}`
+
+Retrieve a specific environment by ID.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments retrieve \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## Update
+
+`$ ant beta:environments update`
+
+**post** `/v1/environments/{environment_id}`
+
+Update an existing environment's configuration.
+
+### Parameters
+
+- `--environment-id: string`
+
+ Path param
+
+- `--config: optional object { type, networking, packages }`
+
+ Body param: Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+- `--description: optional string`
+
+ Body param: Updated description of the environment
+
+- `--metadata: optional map[string]`
+
+ Body param: User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.
+
+- `--name: optional string`
+
+ Body param: Updated name for the environment
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments update \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## Delete
+
+`$ ant beta:environments delete`
+
+**delete** `/v1/environments/{environment_id}`
+
+Delete an environment by ID. Returns a confirmation of the deletion.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment_delete_response: object { id, type }`
+
+ Response after deleting an environment.
+
+ - `id: string`
+
+ Environment identifier
+
+ - `type: "environment_deleted"`
+
+ The type of response
+
+### Example
+
+```cli
+ant beta:environments delete \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## Archive
+
+`$ ant beta:environments archive`
+
+**post** `/v1/environments/{environment_id}/archive`
+
+Archive an environment by ID. Archived environments cannot be used to create new sessions.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments archive \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## Domain Types
+
+### Beta Cloud Config
+
+- `beta_cloud_config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+### Beta Cloud Config Params
+
+- `beta_cloud_config_params: object { type, networking, packages }`
+
+ Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `networking: optional BetaUnrestrictedNetwork or BetaLimitedNetworkParams`
+
+ Network configuration policy. Omit on update to preserve the existing value.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network_params: object { type, allow_mcp_servers, allow_package_managers, allowed_hosts }`
+
+ Limited network request params.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `allow_mcp_servers: optional boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `allow_package_managers: optional boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `allowed_hosts: optional array of string`
+
+ Specifies domains the container can reach.
+
+ - `packages: optional object { apt, cargo, gem, 4 more }`
+
+ Specify packages (and optionally their versions) available in this environment.
+
+ When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest.
+
+ - `apt: optional array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: optional array of string`
+
+ Rust packages to install
+
+ - `gem: optional array of string`
+
+ Ruby packages to install
+
+ - `go: optional array of string`
+
+ Go packages to install
+
+ - `npm: optional array of string`
+
+ Node.js packages to install
+
+ - `pip: optional array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+### Beta Environment
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Beta Environment Delete Response
+
+- `beta_environment_delete_response: object { id, type }`
+
+ Response after deleting an environment.
+
+ - `id: string`
+
+ Environment identifier
+
+ - `type: "environment_deleted"`
+
+ The type of response
+
+### Beta Limited Network
+
+- `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+### Beta Limited Network Params
+
+- `beta_limited_network_params: object { type, allow_mcp_servers, allow_package_managers, allowed_hosts }`
+
+ Limited network request params.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `allow_mcp_servers: optional boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `allow_package_managers: optional boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `allowed_hosts: optional array of string`
+
+ Specifies domains the container can reach.
+
+### Beta Packages
+
+- `beta_packages: object { apt, cargo, gem, 4 more }`
+
+ Packages (and their versions) available in this environment.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+### Beta Packages Params
+
+- `beta_packages_params: object { apt, cargo, gem, 4 more }`
+
+ Specify packages (and optionally their versions) available in this environment.
+
+ When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest.
+
+ - `apt: optional array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: optional array of string`
+
+ Rust packages to install
+
+ - `gem: optional array of string`
+
+ Ruby packages to install
+
+ - `go: optional array of string`
+
+ Go packages to install
+
+ - `npm: optional array of string`
+
+ Node.js packages to install
+
+ - `pip: optional array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+### Beta Unrestricted Network
+
+- `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+# Sessions
+
+## Create
+
+`$ ant beta:sessions create`
+
+**post** `/v1/sessions`
+
+Create Session
+
+### Parameters
+
+- `--agent: string or BetaManagedAgentsAgentParams`
+
+ Body param: Agent identifier. Accepts the `agent` ID string, which pins the latest version for the session, or an `agent` object with both id and version specified.
+
+- `--environment-id: string`
+
+ Body param: ID of the `environment` defining the container configuration for this session.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata attached to the session.
+
+- `--resource: optional array of BetaManagedAgentsGitHubRepositoryResourceParams or BetaManagedAgentsFileResourceParams`
+
+ Body param: Resources (e.g. repositories, files) to mount into the session's container.
+
+- `--title: optional string`
+
+ Body param: Human-readable session title.
+
+- `--vault-id: optional array of string`
+
+ Body param: Vault IDs for stored credentials the agent can use during the session.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions create \
+ --api-key my-anthropic-api-key \
+ --agent agent_011CZkYpogX7uDKUyvBTophP \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## List
+
+`$ ant beta:sessions list`
+
+**get** `/v1/sessions`
+
+List Sessions
+
+### Parameters
+
+- `--agent-id: optional string`
+
+ Query param: Filter sessions created with this agent ID.
+
+- `--agent-version: optional number`
+
+ Query param: Filter by agent version. Only applies when agent_id is also set.
+
+- `--created-at-gt: optional string`
+
+ Query param: Return sessions created after this time (exclusive).
+
+- `--created-at-gte: optional string`
+
+ Query param: Return sessions created at or after this time (inclusive).
+
+- `--created-at-lt: optional string`
+
+ Query param: Return sessions created before this time (exclusive).
+
+- `--created-at-lte: optional string`
+
+ Query param: Return sessions created at or before this time (inclusive).
+
+- `--include-archived: optional boolean`
+
+ Query param: When true, includes archived sessions. Default: false (exclude archived).
+
+- `--limit: optional number`
+
+ Query param: Maximum number of results to return.
+
+- `--order: optional "asc" or "desc"`
+
+ Query param: Sort direction for results, ordered by created_at. Defaults to desc (newest first).
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response's next_page.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessions: object { data, next_page }`
+
+ Paginated list of sessions.
+
+ - `data: optional array of BetaManagedAgentsSession`
+
+ List of sessions.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:sessions retrieve`
+
+**get** `/v1/sessions/{session_id}`
+
+Get Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions retrieve \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Update
+
+`$ ant beta:sessions update`
+
+**post** `/v1/sessions/{session_id}`
+
+Update Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.
+
+- `--title: optional string`
+
+ Body param: Human-readable session title.
+
+- `--vault-id: optional array of string`
+
+ Body param: Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions update \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Delete
+
+`$ ant beta:sessions delete`
+
+**delete** `/v1/sessions/{session_id}`
+
+Delete Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_session: object { id, type }`
+
+ Confirmation that a `session` has been permanently deleted.
+
+ - `id: string`
+
+ - `type: "session_deleted"`
+
+ - `"session_deleted"`
+
+### Example
+
+```cli
+ant beta:sessions delete \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Archive
+
+`$ ant beta:sessions archive`
+
+**post** `/v1/sessions/{session_id}/archive`
+
+Archive Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions archive \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Domain Types
+
+### Beta Managed Agents Agent Params
+
+- `beta_managed_agents_agent_params: object { id, type, version }`
+
+ Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version
+
+ - `id: string`
+
+ The `agent` ID.
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: optional number`
+
+ The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.
+
+### Beta Managed Agents Branch Checkout
+
+- `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+### Beta Managed Agents Cache Creation Usage
+
+- `beta_managed_agents_cache_creation_usage: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+### Beta Managed Agents Commit Checkout
+
+- `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+### Beta Managed Agents Deleted Session
+
+- `beta_managed_agents_deleted_session: object { id, type }`
+
+ Confirmation that a `session` has been permanently deleted.
+
+ - `id: string`
+
+ - `type: "session_deleted"`
+
+ - `"session_deleted"`
+
+### Beta Managed Agents File Resource Params
+
+- `beta_managed_agents_file_resource_params: object { file_id, type, mount_path }`
+
+ Mount a file uploaded via the Files API into the session.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `mount_path: optional string`
+
+ Mount path in the container. Defaults to `/mnt/session/uploads/`.
+
+### Beta Managed Agents GitHub Repository Resource Params
+
+- `beta_managed_agents_github_repository_resource_params: object { authorization_token, type, url, 2 more }`
+
+ Mount a GitHub repository into the session's container.
+
+ - `authorization_token: string`
+
+ GitHub authorization token used to clone the repository.
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `url: string`
+
+ Github URL of the repository
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ Branch or commit to check out. Defaults to the repository's default branch.
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `mount_path: optional string`
+
+ Mount path in the container. Defaults to `/workspace/`.
+
+### Beta Managed Agents Session
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Beta Managed Agents Session Agent
+
+- `beta_managed_agents_session_agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+### Beta Managed Agents Session Stats
+
+- `beta_managed_agents_session_stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+### Beta Managed Agents Session Usage
+
+- `beta_managed_agents_session_usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+# Events
+
+## List
+
+`$ ant beta:sessions:events list`
+
+**get** `/v1/sessions/{session_id}/events`
+
+List Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--limit: optional number`
+
+ Query param: Query parameter for limit
+
+- `--order: optional "asc" or "desc"`
+
+ Query param: Sort direction for results, ordered by created_at. Defaults to asc (chronological).
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response's next_page.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessionEvents: object { data, next_page }`
+
+ Paginated list of events for a `session`.
+
+ - `data: optional array of BetaManagedAgentsSessionEvent`
+
+ Events for the session, ordered by `created_at`.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions:events list \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Send
+
+`$ ant beta:sessions:events send`
+
+**post** `/v1/sessions/{session_id}/events`
+
+Send Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--event: array of BetaManagedAgentsEventParams`
+
+ Body param: Events to send to the `session`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_send_session_events: object { data }`
+
+ Events that were successfully sent to the session.
+
+ - `data: optional array of BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or BetaManagedAgentsUserCustomToolResultEvent`
+
+ Sent events
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:events send \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --event "{content: [{text: 'Where is my order #1234?', type: text}], type: user.message}"
+```
+
+## Stream
+
+`$ ant beta:sessions:events stream`
+
+**get** `/v1/sessions/{session_id}/events/stream`
+
+Stream Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_stream_session_events: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Server-sent event in the session stream.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Example
+
+```cli
+ant beta:sessions:events stream \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Domain Types
+
+### Beta Managed Agents Agent Custom Tool Use Event
+
+- `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+### Beta Managed Agents Agent MCP Tool Result Event
+
+- `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents Agent MCP Tool Use Event
+
+- `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+### Beta Managed Agents Agent Message Event
+
+- `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+### Beta Managed Agents Agent Thinking Event
+
+- `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+### Beta Managed Agents Agent Thread Context Compacted Event
+
+- `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+### Beta Managed Agents Agent Tool Result Event
+
+- `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents Agent Tool Use Event
+
+- `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+### Beta Managed Agents Base64 Document Source
+
+- `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+### Beta Managed Agents Base64 Image Source
+
+- `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+### Beta Managed Agents Billing Error
+
+- `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+### Beta Managed Agents Document Block
+
+- `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+### Beta Managed Agents Event Params
+
+- `beta_managed_agents_event_params: BetaManagedAgentsUserMessageEventParams or BetaManagedAgentsUserInterruptEventParams or BetaManagedAgentsUserToolConfirmationEventParams or BetaManagedAgentsUserCustomToolResultEventParams`
+
+ Union type for event parameters that can be sent to a session.
+
+ - `beta_managed_agents_user_message_event_params: object { content, type }`
+
+ Parameters for sending a user message to the session.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks for the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `beta_managed_agents_user_interrupt_event_params: object { type }`
+
+ Parameters for sending an interrupt to pause the agent.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `beta_managed_agents_user_tool_confirmation_event_params: object { result, tool_use_id, type, deny_message }`
+
+ Parameters for confirming or denying a tool execution request.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `beta_managed_agents_user_custom_tool_result_event_params: object { custom_tool_use_id, type, content, is_error }`
+
+ Parameters for providing the result of a custom tool execution.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents File Document Source
+
+- `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+### Beta Managed Agents File Image Source
+
+- `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+### Beta Managed Agents Image Block
+
+- `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+### Beta Managed Agents MCP Authentication Failed Error
+
+- `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+### Beta Managed Agents MCP Connection Failed Error
+
+- `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+### Beta Managed Agents Model Overloaded Error
+
+- `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+### Beta Managed Agents Model Rate Limited Error
+
+- `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+### Beta Managed Agents Model Request Failed Error
+
+- `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+### Beta Managed Agents Plain Text Document Source
+
+- `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+### Beta Managed Agents Retry Status Exhausted
+
+- `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+### Beta Managed Agents Retry Status Retrying
+
+- `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+### Beta Managed Agents Retry Status Terminal
+
+- `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+### Beta Managed Agents Send Session Events
+
+- `beta_managed_agents_send_session_events: object { data }`
+
+ Events that were successfully sent to the session.
+
+ - `data: optional array of BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or BetaManagedAgentsUserCustomToolResultEvent`
+
+ Sent events
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents Session Deleted Event
+
+- `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Session End Turn
+
+- `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+### Beta Managed Agents Session Error Event
+
+- `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+### Beta Managed Agents Session Event
+
+- `beta_managed_agents_session_event: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Union type for all event types in a session.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Session Requires Action
+
+- `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+### Beta Managed Agents Session Retries Exhausted
+
+- `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+### Beta Managed Agents Session Status Idle Event
+
+- `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+### Beta Managed Agents Session Status Rescheduled Event
+
+- `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+### Beta Managed Agents Session Status Running Event
+
+- `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+### Beta Managed Agents Session Status Terminated Event
+
+- `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+### Beta Managed Agents Span Model Request End Event
+
+- `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+### Beta Managed Agents Span Model Request Start Event
+
+- `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+### Beta Managed Agents Span Model Usage
+
+- `beta_managed_agents_span_model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Managed Agents Stream Session Events
+
+- `beta_managed_agents_stream_session_events: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Server-sent event in the session stream.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Text Block
+
+- `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+### Beta Managed Agents Unknown Error
+
+- `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+### Beta Managed Agents URL Document Source
+
+- `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+### Beta Managed Agents URL Image Source
+
+- `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+### Beta Managed Agents User Custom Tool Result Event
+
+- `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Custom Tool Result Event Params
+
+- `beta_managed_agents_user_custom_tool_result_event_params: object { custom_tool_use_id, type, content, is_error }`
+
+ Parameters for providing the result of a custom tool execution.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents User Interrupt Event
+
+- `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Interrupt Event Params
+
+- `beta_managed_agents_user_interrupt_event_params: object { type }`
+
+ Parameters for sending an interrupt to pause the agent.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+### Beta Managed Agents User Message Event
+
+- `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Message Event Params
+
+- `beta_managed_agents_user_message_event_params: object { content, type }`
+
+ Parameters for sending a user message to the session.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks for the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+### Beta Managed Agents User Tool Confirmation Event
+
+- `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Tool Confirmation Event Params
+
+- `beta_managed_agents_user_tool_confirmation_event_params: object { result, tool_use_id, type, deny_message }`
+
+ Parameters for confirming or denying a tool execution request.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+# Resources
+
+## Add
+
+`$ ant beta:sessions:resources add`
+
+**post** `/v1/sessions/{session_id}/resources`
+
+Add Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--file-id: string`
+
+ Body param: ID of a previously uploaded file.
+
+- `--type: "file"`
+
+ Body param
+
+- `--mount-path: optional string`
+
+ Body param: Mount path in the container. Defaults to `/mnt/session/uploads/`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources add \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --file-id file_011CNha8iCJcU1wXNR6q4V8w \
+ --type file
+```
+
+## List
+
+`$ ant beta:sessions:resources list`
+
+**get** `/v1/sessions/{session_id}/resources`
+
+List Session Resources
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--limit: optional number`
+
+ Query param: Maximum number of resources to return per page (max 1000). If omitted, returns all resources.
+
+- `--page: optional string`
+
+ Query param: Opaque cursor from a previous response's next_page field.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessionResources: object { data, next_page }`
+
+ Paginated list of resources attached to a session.
+
+ - `data: array of BetaManagedAgentsSessionResource`
+
+ Resources for the session, ordered by `created_at`.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions:resources list \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Retrieve
+
+`$ ant beta:sessions:resources retrieve`
+
+**get** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Get Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSessionResourceGetResponse: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ The requested session resource.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources retrieve \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht
+```
+
+## Update
+
+`$ ant beta:sessions:resources update`
+
+**post** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Update Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--authorization-token: string`
+
+ Body param: New authorization token for the resource. Currently only `github_repository` resources support token rotation.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSessionResourceUpdateResponse: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ The updated session resource.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources update \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht \
+ --authorization-token ghp_exampletoken
+```
+
+## Delete
+
+`$ ant beta:sessions:resources delete`
+
+**delete** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Delete Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_delete_session_resource: object { id, type }`
+
+ Confirmation of resource deletion.
+
+ - `id: string`
+
+ - `type: "session_resource_deleted"`
+
+ - `"session_resource_deleted"`
+
+### Example
+
+```cli
+ant beta:sessions:resources delete \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht
+```
+
+## Domain Types
+
+### Beta Managed Agents Delete Session Resource
+
+- `beta_managed_agents_delete_session_resource: object { id, type }`
+
+ Confirmation of resource deletion.
+
+ - `id: string`
+
+ - `type: "session_resource_deleted"`
+
+ - `"session_resource_deleted"`
+
+### Beta Managed Agents File Resource
+
+- `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents GitHub Repository Resource
+
+- `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+### Beta Managed Agents Session Resource
+
+- `beta_managed_agents_session_resource: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+# Vaults
+
+## Create
+
+`$ ant beta:vaults create`
+
+**post** `/v1/vaults`
+
+Create Vault
+
+### Parameters
+
+- `--display-name: string`
+
+ Body param: Human-readable name for the vault. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata to attach to the vault.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults create \
+ --api-key my-anthropic-api-key \
+ --display-name 'Example vault'
+```
+
+## List
+
+`$ ant beta:vaults list`
+
+**get** `/v1/vaults`
+
+List Vaults
+
+### Parameters
+
+- `--include-archived: optional boolean`
+
+ Query param: Whether to include archived vaults in the results.
+
+- `--limit: optional number`
+
+ Query param: Maximum number of vaults to return per page. Defaults to 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination token from a previous `list_vaults` response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListVaultsResponse: object { data, next_page }`
+
+ Response containing a paginated list of vaults.
+
+ - `data: optional array of BetaManagedAgentsVault`
+
+ List of vaults.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `next_page: optional string`
+
+ Pagination token for the next page, or null if no more results.
+
+### Example
+
+```cli
+ant beta:vaults list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:vaults retrieve`
+
+**get** `/v1/vaults/{vault_id}`
+
+Get Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults retrieve \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Update
+
+`$ ant beta:vaults update`
+
+**post** `/v1/vaults/{vault_id}`
+
+Update Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--display-name: optional string`
+
+ Body param: Updated human-readable name for the vault. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults update \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Delete
+
+`$ ant beta:vaults delete`
+
+**delete** `/v1/vaults/{vault_id}`
+
+Delete Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_vault: object { id, type }`
+
+ Confirmation of a deleted vault.
+
+ - `id: string`
+
+ Unique identifier of the deleted vault.
+
+ - `type: "vault_deleted"`
+
+ - `"vault_deleted"`
+
+### Example
+
+```cli
+ant beta:vaults delete \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Archive
+
+`$ ant beta:vaults archive`
+
+**post** `/v1/vaults/{vault_id}/archive`
+
+Archive Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults archive \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Domain Types
+
+### Beta Managed Agents Deleted Vault
+
+- `beta_managed_agents_deleted_vault: object { id, type }`
+
+ Confirmation of a deleted vault.
+
+ - `id: string`
+
+ Unique identifier of the deleted vault.
+
+ - `type: "vault_deleted"`
+
+ - `"vault_deleted"`
+
+### Beta Managed Agents Vault
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+# Credentials
+
+## Create
+
+`$ ant beta:vaults:credentials create`
+
+**post** `/v1/vaults/{vault_id}/credentials`
+
+Create Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--auth: BetaManagedAgentsMCPOAuthCreateParams or BetaManagedAgentsStaticBearerCreateParams`
+
+ Body param: Authentication details for creating a credential.
+
+- `--display-name: optional string`
+
+ Body param: Human-readable name for the credential. Up to 255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata to attach to the credential.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials create \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --auth '{token: bearer_exampletoken, mcp_server_url: https://example-server.modelcontextprotocol.io/sse, type: static_bearer}'
+```
+
+## List
+
+`$ ant beta:vaults:credentials list`
+
+**get** `/v1/vaults/{vault_id}/credentials`
+
+List Credentials
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--include-archived: optional boolean`
+
+ Query param: Whether to include archived credentials in the results.
+
+- `--limit: optional number`
+
+ Query param: Maximum number of credentials to return per page. Defaults to 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination token from a previous `list_credentials` response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListCredentialsResponse: object { data, next_page }`
+
+ Response containing a paginated list of credentials.
+
+ - `data: optional array of BetaManagedAgentsCredential`
+
+ List of credentials.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+ - `next_page: optional string`
+
+ Pagination token for the next page, or null if no more results.
+
+### Example
+
+```cli
+ant beta:vaults:credentials list \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Retrieve
+
+`$ ant beta:vaults:credentials retrieve`
+
+**get** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Get Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials retrieve \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Update
+
+`$ ant beta:vaults:credentials update`
+
+**post** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Update Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--auth: optional BetaManagedAgentsMCPOAuthUpdateParams or BetaManagedAgentsStaticBearerUpdateParams`
+
+ Body param: Updated authentication details for a credential.
+
+- `--display-name: optional string`
+
+ Body param: Updated human-readable name for the credential. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials update \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Delete
+
+`$ ant beta:vaults:credentials delete`
+
+**delete** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Delete Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_credential: object { id, type }`
+
+ Confirmation of a deleted credential.
+
+ - `id: string`
+
+ Unique identifier of the deleted credential.
+
+ - `type: "vault_credential_deleted"`
+
+ - `"vault_credential_deleted"`
+
+### Example
+
+```cli
+ant beta:vaults:credentials delete \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Archive
+
+`$ ant beta:vaults:credentials archive`
+
+**post** `/v1/vaults/{vault_id}/credentials/{credential_id}/archive`
+
+Archive Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials archive \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Domain Types
+
+### Beta Managed Agents Credential
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Beta Managed Agents Deleted Credential
+
+- `beta_managed_agents_deleted_credential: object { id, type }`
+
+ Confirmation of a deleted credential.
+
+ - `id: string`
+
+ Unique identifier of the deleted credential.
+
+ - `type: "vault_credential_deleted"`
+
+ - `"vault_credential_deleted"`
+
+### Beta Managed Agents MCP OAuth Auth Response
+
+- `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Create Params
+
+- `beta_managed_agents_mcp_oauth_create_params: object { access_token, mcp_server_url, type, 2 more }`
+
+ Parameters for creating an MCP OAuth credential.
+
+ - `access_token: string`
+
+ OAuth access token.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, refresh_token, token_endpoint, 3 more }`
+
+ OAuth refresh token parameters for creating a credential with refresh support.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `refresh_token: string`
+
+ OAuth refresh token.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneParam or BetaManagedAgentsTokenEndpointAuthBasicParam or BetaManagedAgentsTokenEndpointAuthPostParam`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Params
+
+- `beta_managed_agents_mcp_oauth_refresh_params: object { client_id, refresh_token, token_endpoint, 3 more }`
+
+ OAuth refresh token parameters for creating a credential with refresh support.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `refresh_token: string`
+
+ OAuth refresh token.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneParam or BetaManagedAgentsTokenEndpointAuthBasicParam or BetaManagedAgentsTokenEndpointAuthPostParam`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Response
+
+- `beta_managed_agents_mcp_oauth_refresh_response: object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Update Params
+
+- `beta_managed_agents_mcp_oauth_refresh_update_params: object { refresh_token, scope, token_endpoint_auth }`
+
+ Parameters for updating OAuth refresh token configuration.
+
+ - `refresh_token: optional string`
+
+ Updated OAuth refresh token.
+
+ - `scope: optional string`
+
+ Updated OAuth scope for the refresh request.
+
+ - `token_endpoint_auth: optional BetaManagedAgentsTokenEndpointAuthBasicUpdateParam or BetaManagedAgentsTokenEndpointAuthPostUpdateParam`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+ - `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents MCP OAuth Update Params
+
+- `beta_managed_agents_mcp_oauth_update_params: object { type, access_token, expires_at, refresh }`
+
+ Parameters for updating an MCP OAuth credential. The `mcp_server_url` is immutable.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `access_token: optional string`
+
+ Updated OAuth access token.
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { refresh_token, scope, token_endpoint_auth }`
+
+ Parameters for updating OAuth refresh token configuration.
+
+ - `refresh_token: optional string`
+
+ Updated OAuth refresh token.
+
+ - `scope: optional string`
+
+ Updated OAuth scope for the refresh request.
+
+ - `token_endpoint_auth: optional BetaManagedAgentsTokenEndpointAuthBasicUpdateParam or BetaManagedAgentsTokenEndpointAuthPostUpdateParam`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+ - `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents Static Bearer Auth Response
+
+- `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+### Beta Managed Agents Static Bearer Create Params
+
+- `beta_managed_agents_static_bearer_create_params: object { token, mcp_server_url, type }`
+
+ Parameters for creating a static bearer token credential.
+
+ - `token: string`
+
+ Static bearer token value.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+### Beta Managed Agents Static Bearer Update Params
+
+- `beta_managed_agents_static_bearer_update_params: object { type, token }`
+
+ Parameters for updating a static bearer token credential. The `mcp_server_url` is immutable.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `token: optional string`
+
+ Updated static bearer token value.
+
+### Beta Managed Agents Token Endpoint Auth Basic Param
+
+- `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+### Beta Managed Agents Token Endpoint Auth Basic Response
+
+- `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+### Beta Managed Agents Token Endpoint Auth Basic Update Param
+
+- `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents Token Endpoint Auth None Param
+
+- `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+### Beta Managed Agents Token Endpoint Auth None Response
+
+- `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+### Beta Managed Agents Token Endpoint Auth Post Param
+
+- `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+### Beta Managed Agents Token Endpoint Auth Post Response
+
+- `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+### Beta Managed Agents Token Endpoint Auth Post Update Param
+
+- `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+# Files
+
+## Upload
+
+`$ ant beta:files upload`
+
+**post** `/v1/files`
+
+Upload File
+
+### Parameters
+
+- `--file: string`
+
+ Body param: The file to upload
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `file_metadata: object { id, created_at, filename, 5 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+### Example
+
+```cli
+ant beta:files upload \
+ --api-key my-anthropic-api-key \
+ --file 'Example data'
+```
+
+## List
+
+`$ ant beta:files list`
+
+**get** `/v1/files`
+
+List Files
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--scope-id: optional string`
+
+ Query param: Filter by scope ID. Only returns files associated with the specified scope (e.g., a session ID).
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaFileListResponse: object { data, first_id, has_more, last_id }`
+
+ - `data: array of FileMetadata`
+
+ List of file metadata objects.
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+ - `first_id: optional string`
+
+ ID of the first file in this page of results.
+
+ - `has_more: optional boolean`
+
+ Whether there are more results available.
+
+ - `last_id: optional string`
+
+ ID of the last file in this page of results.
+
+### Example
+
+```cli
+ant beta:files list \
+ --api-key my-anthropic-api-key
+```
+
+## Download
+
+`$ ant beta:files download`
+
+**get** `/v1/files/{file_id}/content`
+
+Download File
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `unnamed_schema_0: file path`
+
+### Example
+
+```cli
+ant beta:files download \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
+
+## Retrieve Metadata
+
+`$ ant beta:files retrieve-metadata`
+
+**get** `/v1/files/{file_id}`
+
+Get File Metadata
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `file_metadata: object { id, created_at, filename, 5 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+### Example
+
+```cli
+ant beta:files retrieve-metadata \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
+
+## Delete
+
+`$ ant beta:files delete`
+
+**delete** `/v1/files/{file_id}`
+
+Delete File
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `deleted_file: object { id, type }`
+
+ - `id: string`
+
+ ID of the deleted file.
+
+ - `type: optional "file_deleted"`
+
+ Deleted object type.
+
+ For file deletion, this is always `"file_deleted"`.
+
+ - `"file_deleted"`
+
+### Example
+
+```cli
+ant beta:files delete \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
+
+## Domain Types
+
+### Beta File Scope
+
+- `beta_file_scope: object { id, type }`
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+### Deleted File
+
+- `deleted_file: object { id, type }`
+
+ - `id: string`
+
+ ID of the deleted file.
+
+ - `type: optional "file_deleted"`
+
+ Deleted object type.
+
+ For file deletion, this is always `"file_deleted"`.
+
+ - `"file_deleted"`
+
+### File Metadata
+
+- `file_metadata: object { id, created_at, filename, 5 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+# Skills
+
+## Create
+
+`$ ant beta:skills create`
+
+**post** `/v1/skills`
+
+Create Skill
+
+### Parameters
+
+- `--display-title: optional string`
+
+ Body param: Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+- `--file: optional array of string`
+
+ Body param: Files to upload for the skill.
+
+ All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillNewResponse: object { id, created_at, display_title, 4 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+### Example
+
+```cli
+ant beta:skills create \
+ --api-key my-anthropic-api-key
+```
+
+## List
+
+`$ ant beta:skills list`
+
+**get** `/v1/skills`
+
+List Skills
+
+### Parameters
+
+- `--limit: optional number`
+
+ Query param: Number of results to return per page.
+
+ Maximum value is 100. Defaults to 20.
+
+- `--page: optional string`
+
+ Query param: Pagination token for fetching a specific page of results.
+
+ Pass the value from a previous response's `next_page` field to get the next page of results.
+
+- `--source: optional string`
+
+ Query param: Filter skills by source.
+
+ If provided, only skills from the specified source will be returned:
+
+ * `"custom"`: only return user-created skills
+ * `"anthropic"`: only return Anthropic-created skills
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListSkillsResponse: object { data, has_more, next_page }`
+
+ - `data: array of object { id, created_at, display_title, 4 more }`
+
+ List of skills.
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+ - `has_more: boolean`
+
+ Whether there are more results available.
+
+ If `true`, there are additional results that can be fetched using the `next_page` token.
+
+ - `next_page: string`
+
+ Token for fetching the next page of results.
+
+ If `null`, there are no more results available. Pass this value to the `page_token` parameter in the next request to get the next page.
+
+### Example
+
+```cli
+ant beta:skills list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:skills retrieve`
+
+**get** `/v1/skills/{skill_id}`
+
+Get Skill
+
+### Parameters
+
+- `--skill-id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillGetResponse: object { id, created_at, display_title, 4 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+### Example
+
+```cli
+ant beta:skills retrieve \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+## Delete
+
+`$ ant beta:skills delete`
+
+**delete** `/v1/skills/{skill_id}`
+
+Delete Skill
+
+### Parameters
+
+- `--skill-id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillDeleteResponse: object { id, type }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `type: string`
+
+ Deleted object type.
+
+ For Skills, this is always `"skill_deleted"`.
+
+### Example
+
+```cli
+ant beta:skills delete \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+# Versions
+
+## Create
+
+`$ ant beta:skills:versions create`
+
+**post** `/v1/skills/{skill_id}/versions`
+
+Create Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--file: optional array of string`
+
+ Body param: Files to upload for the skill.
+
+ All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionNewResponse: object { id, created_at, description, 5 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+### Example
+
+```cli
+ant beta:skills:versions create \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+## List
+
+`$ ant beta:skills:versions list`
+
+**get** `/v1/skills/{skill_id}/versions`
+
+List Skill Versions
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--page: optional string`
+
+ Query param: Optionally set to the `next_page` token from the previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListSkillVersionsResponse: object { data, has_more, next_page }`
+
+ - `data: array of object { id, created_at, description, 5 more }`
+
+ List of skill versions.
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `next_page: string`
+
+ Token to provide in as `page` in the subsequent request to retrieve the next page of data.
+
+### Example
+
+```cli
+ant beta:skills:versions list \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+## Retrieve
+
+`$ ant beta:skills:versions retrieve`
+
+**get** `/v1/skills/{skill_id}/versions/{version}`
+
+Get Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--version: string`
+
+ Path param: Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionGetResponse: object { id, created_at, description, 5 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+### Example
+
+```cli
+ant beta:skills:versions retrieve \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id \
+ --version version
+```
+
+## Delete
+
+`$ ant beta:skills:versions delete`
+
+**delete** `/v1/skills/{skill_id}/versions/{version}`
+
+Delete Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--version: string`
+
+ Path param: Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionDeleteResponse: object { id, type }`
+
+ - `id: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+ - `type: string`
+
+ Deleted object type.
+
+ For Skill Versions, this is always `"skill_version_deleted"`.
+
+### Example
+
+```cli
+ant beta:skills:versions delete \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id \
+ --version version
+```
diff --git a/content/en/api/cli/beta/agents.md b/content/en/api/cli/beta/agents.md
new file mode 100644
index 000000000..30d8fcb78
--- /dev/null
+++ b/content/en/api/cli/beta/agents.md
@@ -0,0 +1,3224 @@
+# Agents
+
+## Create
+
+`$ ant beta:agents create`
+
+**post** `/v1/agents`
+
+Create Agent
+
+### Parameters
+
+- `--model: BetaManagedAgentsModelConfigParams`
+
+ Body param: Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison), e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration control
+
+- `--name: string`
+
+ Body param: Human-readable name for the agent. 1-256 characters.
+
+- `--description: optional string`
+
+ Body param: Description of what the agent does. Up to 2048 characters.
+
+- `--mcp-server: optional array of BetaManagedAgentsURLMCPServerParams`
+
+ Body param: MCP servers this agent connects to. Maximum 20. Names must be unique within the array.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
+
+- `--skill: optional array of BetaManagedAgentsSkillParams`
+
+ Body param: Skills available to the agent. Maximum 20.
+
+- `--system: optional string`
+
+ Body param: System prompt for the agent. Up to 100,000 characters.
+
+- `--tool: optional array of BetaManagedAgentsAgentToolset20260401Params or BetaManagedAgentsMCPToolsetParams or BetaManagedAgentsCustomToolParams`
+
+ Body param: Tool configurations available to the agent. Maximum of 128 tools across all toolsets allowed.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents create \
+ --api-key my-anthropic-api-key \
+ --model '{id: claude-opus-4-6}' \
+ --name 'My First Agent'
+```
+
+## List
+
+`$ ant beta:agents list`
+
+**get** `/v1/agents`
+
+List Agents
+
+### Parameters
+
+- `--created-at-gte: optional string`
+
+ Query param: Return agents created at or after this time (inclusive).
+
+- `--created-at-lte: optional string`
+
+ Query param: Return agents created at or before this time (inclusive).
+
+- `--include-archived: optional boolean`
+
+ Query param: Include archived agents in results. Defaults to false.
+
+- `--limit: optional number`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListAgents: object { data, next_page }`
+
+ Paginated list of agents.
+
+ - `data: optional array of BetaManagedAgentsAgent`
+
+ List of agents.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:agents list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:agents retrieve`
+
+**get** `/v1/agents/{agent_id}`
+
+Get Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--version: optional number`
+
+ Query param: Agent version. Omit for the most recent version. Must be at least 1 if specified.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents retrieve \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
+
+## Update
+
+`$ ant beta:agents update`
+
+**post** `/v1/agents/{agent_id}`
+
+Update Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--version: number`
+
+ Body param: The agent's current version, used to prevent concurrent overwrites. Obtain this value from a create or retrieve response. The request fails if this does not match the server's current version.
+
+- `--description: optional string`
+
+ Body param: Description. Up to 2048 characters. Omit to preserve; send empty string or null to clear.
+
+- `--mcp-server: optional array of BetaManagedAgentsURLMCPServerParams`
+
+ Body param: MCP servers. Full replacement. Omit to preserve; send empty array or null to clear. Names must be unique. Maximum 20.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.
+
+- `--model: optional BetaManagedAgentsModelConfigParams`
+
+ Body param: Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison), e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration control. Omit to preserve. Cannot be cleared.
+
+- `--name: optional string`
+
+ Body param: Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.
+
+- `--skill: optional array of BetaManagedAgentsSkillParams`
+
+ Body param: Skills. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 20.
+
+- `--system: optional string`
+
+ Body param: System prompt. Up to 100,000 characters. Omit to preserve; send empty string or null to clear.
+
+- `--tool: optional array of BetaManagedAgentsAgentToolset20260401Params or BetaManagedAgentsMCPToolsetParams or BetaManagedAgentsCustomToolParams`
+
+ Body param: Tool configurations available to the agent. Full replacement. Omit to preserve; send empty array or null to clear. Maximum of 128 tools across all toolsets allowed.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents update \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP \
+ --version 1
+```
+
+## Archive
+
+`$ ant beta:agents archive`
+
+**post** `/v1/agents/{agent_id}/archive`
+
+Archive Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path parameter agent_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents archive \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
+
+## Domain Types
+
+### Beta Managed Agents Agent
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Beta Managed Agents Agent Tool Config
+
+- `beta_managed_agents_agent_tool_config: object { enabled, name, permission_policy }`
+
+ Configuration for a specific agent tool.
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Agent Tool Config Params
+
+- `beta_managed_agents_agent_tool_config_params: object { name, enabled, permission_policy }`
+
+ Configuration override for a specific tool within a toolset.
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `enabled: optional boolean`
+
+ Whether this tool is enabled and available to Claude. Overrides the default_config setting.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Agent Toolset Default Config
+
+- `beta_managed_agents_agent_toolset_default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Agent Toolset Default Config Params
+
+- `beta_managed_agents_agent_toolset_default_config_params: object { enabled, permission_policy }`
+
+ Default configuration for all tools in a toolset.
+
+ - `enabled: optional boolean`
+
+ Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Agent Toolset20260401
+
+- `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+### Beta Managed Agents Agent Toolset20260401 Params
+
+- `beta_managed_agents_agent_toolset20260401_params: object { type, configs, default_config }`
+
+ Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `configs: optional array of BetaManagedAgentsAgentToolConfigParams`
+
+ Per-tool configuration overrides.
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `enabled: optional boolean`
+
+ Whether this tool is enabled and available to Claude. Overrides the default_config setting.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: optional object { enabled, permission_policy }`
+
+ Default configuration for all tools in a toolset.
+
+ - `enabled: optional boolean`
+
+ Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Always Allow Policy
+
+- `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+### Beta Managed Agents Always Ask Policy
+
+- `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Anthropic Skill
+
+- `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+### Beta Managed Agents Anthropic Skill Params
+
+- `beta_managed_agents_anthropic_skill_params: object { skill_id, type, version }`
+
+ An Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ Identifier of the Anthropic skill (e.g., "xlsx").
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: optional string`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents Custom Skill
+
+- `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+### Beta Managed Agents Custom Skill Params
+
+- `beta_managed_agents_custom_skill_params: object { skill_id, type, version }`
+
+ A user-created custom skill.
+
+ - `skill_id: string`
+
+ Tagged ID of the custom skill (e.g., "skill_01XJ5...").
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: optional string`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents Custom Tool
+
+- `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+### Beta Managed Agents Custom Tool Input Schema
+
+- `beta_managed_agents_custom_tool_input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+### Beta Managed Agents Custom Tool Params
+
+- `beta_managed_agents_custom_tool_params: object { description, input_schema, name, type }`
+
+ A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.
+
+ - `description: string`
+
+ Description of what the tool does, shown to the agent to help it decide when to use the tool. 1-1024 characters.
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+### Beta Managed Agents MCP Server URL Definition
+
+- `beta_managed_agents_mcp_server_url_definition: object { name, type, url }`
+
+ URL-based MCP server connection as returned in API responses.
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+### Beta Managed Agents MCP Tool Config
+
+- `beta_managed_agents_mcp_tool_config: object { enabled, name, permission_policy }`
+
+ Resolved configuration for a specific MCP tool.
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents MCP Tool Config Params
+
+- `beta_managed_agents_mcp_tool_config_params: object { name, enabled, permission_policy }`
+
+ Configuration override for a specific MCP tool.
+
+ - `name: string`
+
+ Name of the MCP tool to configure. 1-128 characters.
+
+ - `enabled: optional boolean`
+
+ Whether this tool is enabled. Overrides the `default_config` setting.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents MCP Toolset
+
+- `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+### Beta Managed Agents MCP Toolset Default Config
+
+- `beta_managed_agents_mcp_toolset_default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents MCP Toolset Default Config Params
+
+- `beta_managed_agents_mcp_toolset_default_config_params: object { enabled, permission_policy }`
+
+ Default configuration for all tools from an MCP server.
+
+ - `enabled: optional boolean`
+
+ Whether tools are enabled by default. Defaults to true if not specified.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents MCP Toolset Params
+
+- `beta_managed_agents_mcp_toolset_params: object { mcp_server_name, type, configs, default_config }`
+
+ Configuration for tools from an MCP server defined in `mcp_servers`.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `configs: optional array of BetaManagedAgentsMCPToolConfigParams`
+
+ Per-tool configuration overrides.
+
+ - `name: string`
+
+ Name of the MCP tool to configure. 1-128 characters.
+
+ - `enabled: optional boolean`
+
+ Whether this tool is enabled. Overrides the `default_config` setting.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: optional object { enabled, permission_policy }`
+
+ Default configuration for all tools from an MCP server.
+
+ - `enabled: optional boolean`
+
+ Whether tools are enabled by default. Defaults to true if not specified.
+
+ - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+### Beta Managed Agents Model Config
+
+- `beta_managed_agents_model_config: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Managed Agents Model Config Params
+
+- `beta_managed_agents_model_config_params: object { id, speed }`
+
+ An object that defines additional configuration control over model use
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Managed Agents Skill Params
+
+- `beta_managed_agents_skill_params: BetaManagedAgentsAnthropicSkillParams or BetaManagedAgentsCustomSkillParams`
+
+ Skill to load in the session container.
+
+ - `beta_managed_agents_anthropic_skill_params: object { skill_id, type, version }`
+
+ An Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ Identifier of the Anthropic skill (e.g., "xlsx").
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: optional string`
+
+ Version to pin. Defaults to latest if omitted.
+
+ - `beta_managed_agents_custom_skill_params: object { skill_id, type, version }`
+
+ A user-created custom skill.
+
+ - `skill_id: string`
+
+ Tagged ID of the custom skill (e.g., "skill_01XJ5...").
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: optional string`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents URL MCP Server Params
+
+- `beta_managed_agents_url_mcp_server_params: object { name, type, url }`
+
+ URL-based MCP server connection.
+
+ - `name: string`
+
+ Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ Endpoint URL for the MCP server.
+
+# Versions
+
+## List
+
+`$ ant beta:agents:versions list`
+
+**get** `/v1/agents/{agent_id}/versions`
+
+List Agent Versions
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--limit: optional number`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListAgentVersions: object { data, next_page }`
+
+ Paginated list of agent versions.
+
+ - `data: optional array of BetaManagedAgentsAgent`
+
+ Agent versions.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:agents:versions list \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
diff --git a/content/en/api/cli/beta/agents/archive.md b/content/en/api/cli/beta/agents/archive.md
new file mode 100644
index 000000000..2deff6b6e
--- /dev/null
+++ b/content/en/api/cli/beta/agents/archive.md
@@ -0,0 +1,315 @@
+## Archive
+
+`$ ant beta:agents archive`
+
+**post** `/v1/agents/{agent_id}/archive`
+
+Archive Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path parameter agent_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents archive \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
diff --git a/content/en/api/cli/beta/agents/create.md b/content/en/api/cli/beta/agents/create.md
new file mode 100644
index 000000000..8a31871e6
--- /dev/null
+++ b/content/en/api/cli/beta/agents/create.md
@@ -0,0 +1,344 @@
+## Create
+
+`$ ant beta:agents create`
+
+**post** `/v1/agents`
+
+Create Agent
+
+### Parameters
+
+- `--model: BetaManagedAgentsModelConfigParams`
+
+ Body param: Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison), e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration control
+
+- `--name: string`
+
+ Body param: Human-readable name for the agent. 1-256 characters.
+
+- `--description: optional string`
+
+ Body param: Description of what the agent does. Up to 2048 characters.
+
+- `--mcp-server: optional array of BetaManagedAgentsURLMCPServerParams`
+
+ Body param: MCP servers this agent connects to. Maximum 20. Names must be unique within the array.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
+
+- `--skill: optional array of BetaManagedAgentsSkillParams`
+
+ Body param: Skills available to the agent. Maximum 20.
+
+- `--system: optional string`
+
+ Body param: System prompt for the agent. Up to 100,000 characters.
+
+- `--tool: optional array of BetaManagedAgentsAgentToolset20260401Params or BetaManagedAgentsMCPToolsetParams or BetaManagedAgentsCustomToolParams`
+
+ Body param: Tool configurations available to the agent. Maximum of 128 tools across all toolsets allowed.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents create \
+ --api-key my-anthropic-api-key \
+ --model '{id: claude-opus-4-6}' \
+ --name 'My First Agent'
+```
diff --git a/content/en/api/cli/beta/agents/list.md b/content/en/api/cli/beta/agents/list.md
new file mode 100644
index 000000000..aa29354b2
--- /dev/null
+++ b/content/en/api/cli/beta/agents/list.md
@@ -0,0 +1,338 @@
+## List
+
+`$ ant beta:agents list`
+
+**get** `/v1/agents`
+
+List Agents
+
+### Parameters
+
+- `--created-at-gte: optional string`
+
+ Query param: Return agents created at or after this time (inclusive).
+
+- `--created-at-lte: optional string`
+
+ Query param: Return agents created at or before this time (inclusive).
+
+- `--include-archived: optional boolean`
+
+ Query param: Include archived agents in results. Defaults to false.
+
+- `--limit: optional number`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListAgents: object { data, next_page }`
+
+ Paginated list of agents.
+
+ - `data: optional array of BetaManagedAgentsAgent`
+
+ List of agents.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:agents list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/agents/retrieve.md b/content/en/api/cli/beta/agents/retrieve.md
new file mode 100644
index 000000000..5a4fd15e2
--- /dev/null
+++ b/content/en/api/cli/beta/agents/retrieve.md
@@ -0,0 +1,319 @@
+## Retrieve
+
+`$ ant beta:agents retrieve`
+
+**get** `/v1/agents/{agent_id}`
+
+Get Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--version: optional number`
+
+ Query param: Agent version. Omit for the most recent version. Must be at least 1 if specified.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents retrieve \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
diff --git a/content/en/api/cli/beta/agents/update.md b/content/en/api/cli/beta/agents/update.md
new file mode 100644
index 000000000..4028251d0
--- /dev/null
+++ b/content/en/api/cli/beta/agents/update.md
@@ -0,0 +1,352 @@
+## Update
+
+`$ ant beta:agents update`
+
+**post** `/v1/agents/{agent_id}`
+
+Update Agent
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--version: number`
+
+ Body param: The agent's current version, used to prevent concurrent overwrites. Obtain this value from a create or retrieve response. The request fails if this does not match the server's current version.
+
+- `--description: optional string`
+
+ Body param: Description. Up to 2048 characters. Omit to preserve; send empty string or null to clear.
+
+- `--mcp-server: optional array of BetaManagedAgentsURLMCPServerParams`
+
+ Body param: MCP servers. Full replacement. Omit to preserve; send empty array or null to clear. Names must be unique. Maximum 20.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.
+
+- `--model: optional BetaManagedAgentsModelConfigParams`
+
+ Body param: Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison), e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration control. Omit to preserve. Cannot be cleared.
+
+- `--name: optional string`
+
+ Body param: Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.
+
+- `--skill: optional array of BetaManagedAgentsSkillParams`
+
+ Body param: Skills. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 20.
+
+- `--system: optional string`
+
+ Body param: System prompt. Up to 100,000 characters. Omit to preserve; send empty string or null to clear.
+
+- `--tool: optional array of BetaManagedAgentsAgentToolset20260401Params or BetaManagedAgentsMCPToolsetParams or BetaManagedAgentsCustomToolParams`
+
+ Body param: Tool configurations available to the agent. Full replacement. Omit to preserve; send empty array or null to clear. Maximum of 128 tools across all toolsets allowed.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_agent: object { id, archived_at, created_at, 11 more }`
+
+ A Managed Agents `agent`.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```cli
+ant beta:agents update \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP \
+ --version 1
+```
diff --git a/content/en/api/cli/beta/agents/versions.md b/content/en/api/cli/beta/agents/versions.md
new file mode 100644
index 000000000..78f70fea6
--- /dev/null
+++ b/content/en/api/cli/beta/agents/versions.md
@@ -0,0 +1,333 @@
+# Versions
+
+## List
+
+`$ ant beta:agents:versions list`
+
+**get** `/v1/agents/{agent_id}/versions`
+
+List Agent Versions
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--limit: optional number`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListAgentVersions: object { data, next_page }`
+
+ Paginated list of agent versions.
+
+ - `data: optional array of BetaManagedAgentsAgent`
+
+ Agent versions.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:agents:versions list \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
diff --git a/content/en/api/cli/beta/agents/versions/list.md b/content/en/api/cli/beta/agents/versions/list.md
new file mode 100644
index 000000000..a69689a21
--- /dev/null
+++ b/content/en/api/cli/beta/agents/versions/list.md
@@ -0,0 +1,331 @@
+## List
+
+`$ ant beta:agents:versions list`
+
+**get** `/v1/agents/{agent_id}/versions`
+
+List Agent Versions
+
+### Parameters
+
+- `--agent-id: string`
+
+ Path param: Path parameter agent_id
+
+- `--limit: optional number`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListAgentVersions: object { data, next_page }`
+
+ Paginated list of agent versions.
+
+ - `data: optional array of BetaManagedAgentsAgent`
+
+ Agent versions.
+
+ - `id: string`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `metadata: map[string]`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `version: number`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:agents:versions list \
+ --api-key my-anthropic-api-key \
+ --agent-id agent_011CZkYpogX7uDKUyvBTophP
+```
diff --git a/content/en/api/cli/beta/environments.md b/content/en/api/cli/beta/environments.md
new file mode 100644
index 000000000..12a6a548d
--- /dev/null
+++ b/content/en/api/cli/beta/environments.md
@@ -0,0 +1,1196 @@
+# Environments
+
+## Create
+
+`$ ant beta:environments create`
+
+**post** `/v1/environments`
+
+Create a new environment with the specified configuration.
+
+### Parameters
+
+- `--name: string`
+
+ Body param: Human-readable name for the environment
+
+- `--config: optional object { type, networking, packages }`
+
+ Body param: Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+- `--description: optional string`
+
+ Body param: Optional description of the environment
+
+- `--metadata: optional map[string]`
+
+ Body param: User-provided metadata key-value pairs
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments create \
+ --api-key my-anthropic-api-key \
+ --name python-data-analysis
+```
+
+## List
+
+`$ ant beta:environments list`
+
+**get** `/v1/environments`
+
+List environments with pagination support.
+
+### Parameters
+
+- `--include-archived: optional boolean`
+
+ Query param: Include archived environments in the response
+
+- `--limit: optional number`
+
+ Query param: Maximum number of environments to return
+
+- `--page: optional string`
+
+ Query param: Opaque cursor from previous response for pagination. Pass the `next_page` value from the previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaEnvironmentListResponse: object { data, next_page }`
+
+ Response when listing environments.
+
+ This response model uses opaque cursor-based pagination. Use the `page`
+ query parameter with the value from `next_page` to fetch the next page.
+
+ - `data: array of BetaEnvironment`
+
+ List of environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+ - `next_page: string`
+
+ Token for fetching the next page of results. If `null`, there are no more results available. Pass this value to the `page` parameter in the next request.
+
+### Example
+
+```cli
+ant beta:environments list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:environments retrieve`
+
+**get** `/v1/environments/{environment_id}`
+
+Retrieve a specific environment by ID.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments retrieve \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## Update
+
+`$ ant beta:environments update`
+
+**post** `/v1/environments/{environment_id}`
+
+Update an existing environment's configuration.
+
+### Parameters
+
+- `--environment-id: string`
+
+ Path param
+
+- `--config: optional object { type, networking, packages }`
+
+ Body param: Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+- `--description: optional string`
+
+ Body param: Updated description of the environment
+
+- `--metadata: optional map[string]`
+
+ Body param: User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.
+
+- `--name: optional string`
+
+ Body param: Updated name for the environment
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments update \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## Delete
+
+`$ ant beta:environments delete`
+
+**delete** `/v1/environments/{environment_id}`
+
+Delete an environment by ID. Returns a confirmation of the deletion.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment_delete_response: object { id, type }`
+
+ Response after deleting an environment.
+
+ - `id: string`
+
+ Environment identifier
+
+ - `type: "environment_deleted"`
+
+ The type of response
+
+### Example
+
+```cli
+ant beta:environments delete \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## Archive
+
+`$ ant beta:environments archive`
+
+**post** `/v1/environments/{environment_id}/archive`
+
+Archive an environment by ID. Archived environments cannot be used to create new sessions.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments archive \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## Domain Types
+
+### Beta Cloud Config
+
+- `beta_cloud_config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+### Beta Cloud Config Params
+
+- `beta_cloud_config_params: object { type, networking, packages }`
+
+ Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `networking: optional BetaUnrestrictedNetwork or BetaLimitedNetworkParams`
+
+ Network configuration policy. Omit on update to preserve the existing value.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network_params: object { type, allow_mcp_servers, allow_package_managers, allowed_hosts }`
+
+ Limited network request params.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `allow_mcp_servers: optional boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `allow_package_managers: optional boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `allowed_hosts: optional array of string`
+
+ Specifies domains the container can reach.
+
+ - `packages: optional object { apt, cargo, gem, 4 more }`
+
+ Specify packages (and optionally their versions) available in this environment.
+
+ When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest.
+
+ - `apt: optional array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: optional array of string`
+
+ Rust packages to install
+
+ - `gem: optional array of string`
+
+ Ruby packages to install
+
+ - `go: optional array of string`
+
+ Go packages to install
+
+ - `npm: optional array of string`
+
+ Node.js packages to install
+
+ - `pip: optional array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+### Beta Environment
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Beta Environment Delete Response
+
+- `beta_environment_delete_response: object { id, type }`
+
+ Response after deleting an environment.
+
+ - `id: string`
+
+ Environment identifier
+
+ - `type: "environment_deleted"`
+
+ The type of response
+
+### Beta Limited Network
+
+- `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+### Beta Limited Network Params
+
+- `beta_limited_network_params: object { type, allow_mcp_servers, allow_package_managers, allowed_hosts }`
+
+ Limited network request params.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `allow_mcp_servers: optional boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `allow_package_managers: optional boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `allowed_hosts: optional array of string`
+
+ Specifies domains the container can reach.
+
+### Beta Packages
+
+- `beta_packages: object { apt, cargo, gem, 4 more }`
+
+ Packages (and their versions) available in this environment.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+### Beta Packages Params
+
+- `beta_packages_params: object { apt, cargo, gem, 4 more }`
+
+ Specify packages (and optionally their versions) available in this environment.
+
+ When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest.
+
+ - `apt: optional array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: optional array of string`
+
+ Rust packages to install
+
+ - `gem: optional array of string`
+
+ Ruby packages to install
+
+ - `go: optional array of string`
+
+ Go packages to install
+
+ - `npm: optional array of string`
+
+ Node.js packages to install
+
+ - `pip: optional array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+### Beta Unrestricted Network
+
+- `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
diff --git a/content/en/api/cli/beta/environments/archive.md b/content/en/api/cli/beta/environments/archive.md
new file mode 100644
index 000000000..b5302e1eb
--- /dev/null
+++ b/content/en/api/cli/beta/environments/archive.md
@@ -0,0 +1,135 @@
+## Archive
+
+`$ ant beta:environments archive`
+
+**post** `/v1/environments/{environment_id}/archive`
+
+Archive an environment by ID. Archived environments cannot be used to create new sessions.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments archive \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
diff --git a/content/en/api/cli/beta/environments/create.md b/content/en/api/cli/beta/environments/create.md
new file mode 100644
index 000000000..63f39842d
--- /dev/null
+++ b/content/en/api/cli/beta/environments/create.md
@@ -0,0 +1,152 @@
+## Create
+
+`$ ant beta:environments create`
+
+**post** `/v1/environments`
+
+Create a new environment with the specified configuration.
+
+### Parameters
+
+- `--name: string`
+
+ Body param: Human-readable name for the environment
+
+- `--config: optional object { type, networking, packages }`
+
+ Body param: Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+- `--description: optional string`
+
+ Body param: Optional description of the environment
+
+- `--metadata: optional map[string]`
+
+ Body param: User-provided metadata key-value pairs
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments create \
+ --api-key my-anthropic-api-key \
+ --name python-data-analysis
+```
diff --git a/content/en/api/cli/beta/environments/delete.md b/content/en/api/cli/beta/environments/delete.md
new file mode 100644
index 000000000..52ef19e2c
--- /dev/null
+++ b/content/en/api/cli/beta/environments/delete.md
@@ -0,0 +1,37 @@
+## Delete
+
+`$ ant beta:environments delete`
+
+**delete** `/v1/environments/{environment_id}`
+
+Delete an environment by ID. Returns a confirmation of the deletion.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment_delete_response: object { id, type }`
+
+ Response after deleting an environment.
+
+ - `id: string`
+
+ Environment identifier
+
+ - `type: "environment_deleted"`
+
+ The type of response
+
+### Example
+
+```cli
+ant beta:environments delete \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
diff --git a/content/en/api/cli/beta/environments/list.md b/content/en/api/cli/beta/environments/list.md
new file mode 100644
index 000000000..a880e66a9
--- /dev/null
+++ b/content/en/api/cli/beta/environments/list.md
@@ -0,0 +1,155 @@
+## List
+
+`$ ant beta:environments list`
+
+**get** `/v1/environments`
+
+List environments with pagination support.
+
+### Parameters
+
+- `--include-archived: optional boolean`
+
+ Query param: Include archived environments in the response
+
+- `--limit: optional number`
+
+ Query param: Maximum number of environments to return
+
+- `--page: optional string`
+
+ Query param: Opaque cursor from previous response for pagination. Pass the `next_page` value from the previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaEnvironmentListResponse: object { data, next_page }`
+
+ Response when listing environments.
+
+ This response model uses opaque cursor-based pagination. Use the `page`
+ query parameter with the value from `next_page` to fetch the next page.
+
+ - `data: array of BetaEnvironment`
+
+ List of environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+ - `next_page: string`
+
+ Token for fetching the next page of results. If `null`, there are no more results available. Pass this value to the `page` parameter in the next request.
+
+### Example
+
+```cli
+ant beta:environments list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/environments/retrieve.md b/content/en/api/cli/beta/environments/retrieve.md
new file mode 100644
index 000000000..785eba30c
--- /dev/null
+++ b/content/en/api/cli/beta/environments/retrieve.md
@@ -0,0 +1,135 @@
+## Retrieve
+
+`$ ant beta:environments retrieve`
+
+**get** `/v1/environments/{environment_id}`
+
+Retrieve a specific environment by ID.
+
+### Parameters
+
+- `--environment-id: string`
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments retrieve \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
diff --git a/content/en/api/cli/beta/environments/update.md b/content/en/api/cli/beta/environments/update.md
new file mode 100644
index 000000000..e131fbe97
--- /dev/null
+++ b/content/en/api/cli/beta/environments/update.md
@@ -0,0 +1,156 @@
+## Update
+
+`$ ant beta:environments update`
+
+**post** `/v1/environments/{environment_id}`
+
+Update an existing environment's configuration.
+
+### Parameters
+
+- `--environment-id: string`
+
+ Path param
+
+- `--config: optional object { type, networking, packages }`
+
+ Body param: Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+- `--description: optional string`
+
+ Body param: Updated description of the environment
+
+- `--metadata: optional map[string]`
+
+ Body param: User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.
+
+- `--name: optional string`
+
+ Body param: Updated name for the environment
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_environment: object { id, archived_at, config, 6 more }`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `id: string`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `archived_at: string`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `config: object { networking, packages, type }`
+
+ `cloud` environment configuration.
+
+ - `networking: BetaUnrestrictedNetwork or BetaLimitedNetwork`
+
+ Network configuration policy.
+
+ - `beta_unrestricted_network: object { type }`
+
+ Unrestricted network access.
+
+ - `type: "unrestricted"`
+
+ Network policy type
+
+ - `beta_limited_network: object { allow_mcp_servers, allow_package_managers, allowed_hosts, type }`
+
+ Limited network access.
+
+ - `allow_mcp_servers: boolean`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `allow_package_managers: boolean`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `allowed_hosts: array of string`
+
+ Specifies domains the container can reach.
+
+ - `type: "limited"`
+
+ Network policy type
+
+ - `packages: object { apt, cargo, gem, 4 more }`
+
+ Package manager configuration.
+
+ - `apt: array of string`
+
+ Ubuntu/Debian packages to install
+
+ - `cargo: array of string`
+
+ Rust packages to install
+
+ - `gem: array of string`
+
+ Ruby packages to install
+
+ - `go: array of string`
+
+ Go packages to install
+
+ - `npm: array of string`
+
+ Node.js packages to install
+
+ - `pip: array of string`
+
+ Python packages to install
+
+ - `type: optional "packages"`
+
+ Package configuration type
+
+ - `"packages"`
+
+ - `type: "cloud"`
+
+ Environment type
+
+ - `created_at: string`
+
+ RFC 3339 timestamp when environment was created
+
+ - `description: string`
+
+ User-provided description for the environment
+
+ - `metadata: map[string]`
+
+ User-provided metadata key-value pairs
+
+ - `name: string`
+
+ Human-readable name for the environment
+
+ - `type: "environment"`
+
+ The type of object (always 'environment')
+
+ - `updated_at: string`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```cli
+ant beta:environments update \
+ --api-key my-anthropic-api-key \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
diff --git a/content/en/api/cli/beta/files.md b/content/en/api/cli/beta/files.md
index c816c74e5..1d6bcfda2 100644
--- a/content/en/api/cli/beta/files.md
+++ b/content/en/api/cli/beta/files.md
@@ -1 +1,402 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Files
+
+## Upload
+
+`$ ant beta:files upload`
+
+**post** `/v1/files`
+
+Upload File
+
+### Parameters
+
+- `--file: string`
+
+ Body param: The file to upload
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `file_metadata: object { id, created_at, filename, 5 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+### Example
+
+```cli
+ant beta:files upload \
+ --api-key my-anthropic-api-key \
+ --file 'Example data'
+```
+
+## List
+
+`$ ant beta:files list`
+
+**get** `/v1/files`
+
+List Files
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--scope-id: optional string`
+
+ Query param: Filter by scope ID. Only returns files associated with the specified scope (e.g., a session ID).
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaFileListResponse: object { data, first_id, has_more, last_id }`
+
+ - `data: array of FileMetadata`
+
+ List of file metadata objects.
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+ - `first_id: optional string`
+
+ ID of the first file in this page of results.
+
+ - `has_more: optional boolean`
+
+ Whether there are more results available.
+
+ - `last_id: optional string`
+
+ ID of the last file in this page of results.
+
+### Example
+
+```cli
+ant beta:files list \
+ --api-key my-anthropic-api-key
+```
+
+## Download
+
+`$ ant beta:files download`
+
+**get** `/v1/files/{file_id}/content`
+
+Download File
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `unnamed_schema_0: file path`
+
+### Example
+
+```cli
+ant beta:files download \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
+
+## Retrieve Metadata
+
+`$ ant beta:files retrieve-metadata`
+
+**get** `/v1/files/{file_id}`
+
+Get File Metadata
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `file_metadata: object { id, created_at, filename, 5 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+### Example
+
+```cli
+ant beta:files retrieve-metadata \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
+
+## Delete
+
+`$ ant beta:files delete`
+
+**delete** `/v1/files/{file_id}`
+
+Delete File
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `deleted_file: object { id, type }`
+
+ - `id: string`
+
+ ID of the deleted file.
+
+ - `type: optional "file_deleted"`
+
+ Deleted object type.
+
+ For file deletion, this is always `"file_deleted"`.
+
+ - `"file_deleted"`
+
+### Example
+
+```cli
+ant beta:files delete \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
+
+## Domain Types
+
+### Beta File Scope
+
+- `beta_file_scope: object { id, type }`
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+### Deleted File
+
+- `deleted_file: object { id, type }`
+
+ - `id: string`
+
+ ID of the deleted file.
+
+ - `type: optional "file_deleted"`
+
+ Deleted object type.
+
+ For file deletion, this is always `"file_deleted"`.
+
+ - `"file_deleted"`
+
+### File Metadata
+
+- `file_metadata: object { id, created_at, filename, 5 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
diff --git a/content/en/api/cli/beta/files/delete.md b/content/en/api/cli/beta/files/delete.md
index 5d7020f86..a102891af 100644
--- a/content/en/api/cli/beta/files/delete.md
+++ b/content/en/api/cli/beta/files/delete.md
@@ -1 +1,41 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Delete
+
+`$ ant beta:files delete`
+
+**delete** `/v1/files/{file_id}`
+
+Delete File
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `deleted_file: object { id, type }`
+
+ - `id: string`
+
+ ID of the deleted file.
+
+ - `type: optional "file_deleted"`
+
+ Deleted object type.
+
+ For file deletion, this is always `"file_deleted"`.
+
+ - `"file_deleted"`
+
+### Example
+
+```cli
+ant beta:files delete \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
diff --git a/content/en/api/cli/beta/files/download.md b/content/en/api/cli/beta/files/download.md
index f1012e8cb..2370f46ce 100644
--- a/content/en/api/cli/beta/files/download.md
+++ b/content/en/api/cli/beta/files/download.md
@@ -1 +1,29 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Download
+
+`$ ant beta:files download`
+
+**get** `/v1/files/{file_id}/content`
+
+Download File
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `unnamed_schema_0: file path`
+
+### Example
+
+```cli
+ant beta:files download \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
diff --git a/content/en/api/cli/beta/files/list.md b/content/en/api/cli/beta/files/list.md
index 38038a879..b2f3261e5 100644
--- a/content/en/api/cli/beta/files/list.md
+++ b/content/en/api/cli/beta/files/list.md
@@ -1 +1,102 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## List
+
+`$ ant beta:files list`
+
+**get** `/v1/files`
+
+List Files
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--scope-id: optional string`
+
+ Query param: Filter by scope ID. Only returns files associated with the specified scope (e.g., a session ID).
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaFileListResponse: object { data, first_id, has_more, last_id }`
+
+ - `data: array of FileMetadata`
+
+ List of file metadata objects.
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+ - `first_id: optional string`
+
+ ID of the first file in this page of results.
+
+ - `has_more: optional boolean`
+
+ Whether there are more results available.
+
+ - `last_id: optional string`
+
+ ID of the last file in this page of results.
+
+### Example
+
+```cli
+ant beta:files list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/files/retrieve_metadata.md b/content/en/api/cli/beta/files/retrieve_metadata.md
index 0dd556855..8bf47132b 100644
--- a/content/en/api/cli/beta/files/retrieve_metadata.md
+++ b/content/en/api/cli/beta/files/retrieve_metadata.md
@@ -1 +1,73 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Retrieve Metadata
+
+`$ ant beta:files retrieve-metadata`
+
+**get** `/v1/files/{file_id}`
+
+Get File Metadata
+
+### Parameters
+
+- `--file-id: string`
+
+ ID of the File.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `file_metadata: object { id, created_at, filename, 5 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+### Example
+
+```cli
+ant beta:files retrieve-metadata \
+ --api-key my-anthropic-api-key \
+ --file-id file_id
+```
diff --git a/content/en/api/cli/beta/files/upload.md b/content/en/api/cli/beta/files/upload.md
index 85784587f..c31aae6e1 100644
--- a/content/en/api/cli/beta/files/upload.md
+++ b/content/en/api/cli/beta/files/upload.md
@@ -1 +1,73 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Upload
+
+`$ ant beta:files upload`
+
+**post** `/v1/files`
+
+Upload File
+
+### Parameters
+
+- `--file: string`
+
+ Body param: The file to upload
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `file_metadata: object { id, created_at, filename, 5 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing when the file was created.
+
+ - `filename: string`
+
+ Original filename of the uploaded file.
+
+ - `mime_type: string`
+
+ MIME type of the file.
+
+ - `size_bytes: number`
+
+ Size of the file in bytes.
+
+ - `type: "file"`
+
+ Object type.
+
+ For files, this is always `"file"`.
+
+ - `downloadable: optional boolean`
+
+ Whether the file can be downloaded.
+
+ - `scope: optional object { id, type }`
+
+ The scope of this file, indicating the context in which it was created (e.g., a session).
+
+ - `id: string`
+
+ The ID of the scoping resource (e.g., the session ID).
+
+ - `type: "session"`
+
+ The type of scope (e.g., `"session"`).
+
+### Example
+
+```cli
+ant beta:files upload \
+ --api-key my-anthropic-api-key \
+ --file 'Example data'
+```
diff --git a/content/en/api/cli/beta/messages.md b/content/en/api/cli/beta/messages.md
index 74089d159..670b94b34 100644
--- a/content/en/api/cli/beta/messages.md
+++ b/content/en/api/cli/beta/messages.md
@@ -1 +1,26439 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Messages
+
+## Create
+
+`$ ant beta:messages create`
+
+**post** `/v1/messages`
+
+Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
+
+The Messages API can be used for either single queries or stateless multi-turn conversations.
+
+Learn more about the Messages API in our [user guide](https://docs.claude.com/en/docs/initial-setup)
+
+### Parameters
+
+- `--max-tokens: number`
+
+ Body param: The maximum number of tokens to generate before stopping.
+
+ Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
+
+ Different models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details.
+
+- `--message: array of BetaMessageParam`
+
+ Body param: Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ Body param: The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Body param: Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--container: optional BetaContainerParams or string`
+
+ Body param: Container identifier for reuse across requests.
+
+- `--context-management: optional object { edits }`
+
+ Body param: Context management configuration.
+
+ This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.
+
+- `--inference-geo: optional string`
+
+ Body param: Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.
+
+- `--mcp-server: optional array of BetaRequestMCPServerURLDefinition`
+
+ Body param: MCP servers to be utilized in this request
+
+- `--metadata: optional object { user_id }`
+
+ Body param: An object describing metadata about the request.
+
+- `--output-config: optional object { effort, format }`
+
+ Body param: Configuration options for the model's output, such as the output format.
+
+- `--output-format: optional object { schema, type }`
+
+ Body param: Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
+
+- `--service-tier: optional "auto" or "standard_only"`
+
+ Body param: Determines whether to use priority capacity (if available) or standard capacity for this request.
+
+ Anthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
+
+- `--speed: optional "standard" or "fast"`
+
+ Body param: The inference speed mode for this request. `"fast"` enables high output-tokens-per-second inference.
+
+- `--stop-sequence: optional array of string`
+
+ Body param: Custom text sequences that will cause the model to stop generating.
+
+ Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
+
+ If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.
+
+- `--system: optional string or array of BetaTextBlockParam`
+
+ Body param: System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--temperature: optional number`
+
+ Body param: Amount of randomness injected into the response.
+
+ Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
+
+ Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
+
+- `--thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive`
+
+ Body param: Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional BetaToolChoiceAuto or BetaToolChoiceAny or BetaToolChoiceTool or BetaToolChoiceNone`
+
+ Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of BetaToolUnion`
+
+ Body param: Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+- `--top-k: optional number`
+
+ Body param: Only sample from the top K options for each subsequent token.
+
+ Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--top-p: optional number`
+
+ Body param: Use nucleus sampling.
+
+ In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Example
+
+```cli
+ant beta:messages create \
+ --api-key my-anthropic-api-key \
+ --max-tokens 1024 \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-opus-4-6
+```
+
+## Count Tokens
+
+`$ ant beta:messages count-tokens`
+
+**post** `/v1/messages/count_tokens`
+
+Count the number of tokens in a Message.
+
+The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.
+
+Learn more about token counting in our [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
+
+### Parameters
+
+- `--message: array of BetaMessageParam`
+
+ Body param: Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ Body param: The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Body param: Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--context-management: optional object { edits }`
+
+ Body param: Context management configuration.
+
+ This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.
+
+- `--mcp-server: optional array of BetaRequestMCPServerURLDefinition`
+
+ Body param: MCP servers to be utilized in this request
+
+- `--output-config: optional object { effort, format }`
+
+ Body param: Configuration options for the model's output, such as the output format.
+
+- `--output-format: optional object { schema, type }`
+
+ Body param: Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
+
+- `--speed: optional "standard" or "fast"`
+
+ Body param: The inference speed mode for this request. `"fast"` enables high output-tokens-per-second inference.
+
+- `--system: optional string or array of BetaTextBlockParam`
+
+ Body param: System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive`
+
+ Body param: Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional BetaToolChoiceAuto or BetaToolChoiceAny or BetaToolChoiceTool or BetaToolChoiceNone`
+
+ Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of BetaTool or BetaToolBash20241022 or BetaToolBash20250124 or 19 more`
+
+ Body param: Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_tokens_count: object { context_management, input_tokens }`
+
+ - `context_management: object { original_input_tokens }`
+
+ Information about context management applied to the message.
+
+ - `original_input_tokens: number`
+
+ The original token count before context management was applied
+
+ - `input_tokens: number`
+
+ The total number of tokens across the provided list of messages, system prompt, and tools.
+
+### Example
+
+```cli
+ant beta:messages count-tokens \
+ --api-key my-anthropic-api-key \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-mythos-preview
+```
+
+## Domain Types
+
+### Beta All Thinking Turns
+
+- `beta_all_thinking_turns: object { type }`
+
+ - `type: "all"`
+
+### Beta Base64 Image Source
+
+- `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+### Beta Base64 PDF Source
+
+- `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+### Beta Bash Code Execution Output Block
+
+- `beta_bash_code_execution_output_block: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+### Beta Bash Code Execution Output Block Param
+
+- `beta_bash_code_execution_output_block_param: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+### Beta Bash Code Execution Result Block
+
+- `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+### Beta Bash Code Execution Result Block Param
+
+- `beta_bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+### Beta Bash Code Execution Tool Result Block
+
+- `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+### Beta Bash Code Execution Tool Result Block Param
+
+- `beta_bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
+
+ - `beta_bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Bash Code Execution Tool Result Error
+
+- `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+### Beta Bash Code Execution Tool Result Error Param
+
+- `beta_bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+### Beta Cache Control Ephemeral
+
+- `beta_cache_control_ephemeral: object { type, ttl }`
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Cache Creation
+
+- `beta_cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+### Beta Citation Char Location
+
+- `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+### Beta Citation Char Location Param
+
+- `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+### Beta Citation Config
+
+- `beta_citation_config: object { enabled }`
+
+ - `enabled: boolean`
+
+### Beta Citation Content Block Location
+
+- `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+### Beta Citation Content Block Location Param
+
+- `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+### Beta Citation Page Location
+
+- `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+### Beta Citation Page Location Param
+
+- `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+### Beta Citation Search Result Location
+
+- `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Citation Search Result Location Param
+
+- `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Citation Web Search Result Location Param
+
+- `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+### Beta Citations Config Param
+
+- `beta_citations_config_param: object { enabled }`
+
+ - `enabled: optional boolean`
+
+### Beta Citations Delta
+
+- `beta_citations_delta: object { citation, type }`
+
+ - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+### Beta Citations Web Search Result Location
+
+- `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+### Beta Clear Thinking 20251015 Edit
+
+- `beta_clear_thinking_20251015_edit: object { type, keep }`
+
+ - `type: "clear_thinking_20251015"`
+
+ - `keep: optional BetaThinkingTurns or BetaAllThinkingTurns or "all"`
+
+ Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
+
+ - `beta_thinking_turns: object { type, value }`
+
+ - `type: "thinking_turns"`
+
+ - `value: number`
+
+ - `beta_all_thinking_turns: object { type }`
+
+ - `type: "all"`
+
+ - `union_member_2: "all"`
+
+### Beta Clear Thinking 20251015 Edit Response
+
+- `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+### Beta Clear Tool Uses 20250919 Edit
+
+- `beta_clear_tool_uses_20250919_edit: object { type, clear_at_least, clear_tool_inputs, 3 more }`
+
+ - `type: "clear_tool_uses_20250919"`
+
+ - `clear_at_least: optional object { type, value }`
+
+ Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+ - `clear_tool_inputs: optional boolean or array of string`
+
+ Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
+
+ - `union_member_0: boolean`
+
+ - `union_member_1: array of string`
+
+ - `exclude_tools: optional array of string`
+
+ Tool names whose uses are preserved from clearing
+
+ - `keep: optional object { type, value }`
+
+ Number of tool uses to retain in the conversation
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+ - `trigger: optional BetaInputTokensTrigger or BetaToolUsesTrigger`
+
+ Condition that triggers the context management strategy
+
+ - `beta_input_tokens_trigger: object { type, value }`
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+ - `beta_tool_uses_trigger: object { type, value }`
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+### Beta Clear Tool Uses 20250919 Edit Response
+
+- `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+### Beta Code Execution Output Block
+
+- `beta_code_execution_output_block: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+### Beta Code Execution Output Block Param
+
+- `beta_code_execution_output_block_param: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+### Beta Code Execution Result Block
+
+- `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+### Beta Code Execution Result Block Param
+
+- `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+### Beta Code Execution Tool 20250522
+
+- `beta_code_execution_tool_20250522: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250522"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Code Execution Tool 20250825
+
+- `beta_code_execution_tool_20250825: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250825"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Code Execution Tool 20260120
+
+- `beta_code_execution_tool_20260120: object { name, type, allowed_callers, 3 more }`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20260120"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Code Execution Tool Result Block
+
+- `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+### Beta Code Execution Tool Result Block Content
+
+- `beta_code_execution_tool_result_block_content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Beta Code Execution Tool Result Block Param
+
+- `beta_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaCodeExecutionToolResultErrorParam or BetaCodeExecutionResultBlockParam or BetaEncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Code Execution Tool Result Block Param Content
+
+- `beta_code_execution_tool_result_block_param_content: BetaCodeExecutionToolResultErrorParam or BetaCodeExecutionResultBlockParam or BetaEncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Beta Code Execution Tool Result Error
+
+- `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+### Beta Code Execution Tool Result Error Code
+
+- `beta_code_execution_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+### Beta Code Execution Tool Result Error Param
+
+- `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+### Beta Compact 20260112 Edit
+
+- `beta_compact_20260112_edit: object { type, instructions, pause_after_compaction, trigger }`
+
+ Automatically compact older context when reaching the configured trigger threshold.
+
+ - `type: "compact_20260112"`
+
+ - `instructions: optional string`
+
+ Additional instructions for summarization.
+
+ - `pause_after_compaction: optional boolean`
+
+ Whether to pause after compaction and return the compaction block to the user.
+
+ - `trigger: optional object { type, value }`
+
+ When to trigger compaction. Defaults to 150000 input tokens.
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+### Beta Compaction Block
+
+- `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+### Beta Compaction Block Param
+
+- `beta_compaction_block_param: object { content, type, cache_control }`
+
+ A compaction block containing summary of previous context.
+
+ Users should round-trip these blocks from responses to subsequent requests
+ to maintain context across compaction boundaries.
+
+ When content is None, the block represents a failed compaction. The server
+ treats these as no-ops. Empty string content is not allowed.
+
+ - `content: string`
+
+ Summary of previously compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Compaction Content Block Delta
+
+- `beta_compaction_content_block_delta: object { content, type }`
+
+ - `content: string`
+
+ - `type: "compaction_delta"`
+
+### Beta Compaction Iteration Usage
+
+- `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+### Beta Container
+
+- `beta_container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+### Beta Container Params
+
+- `beta_container_params: object { id, skills }`
+
+ Container parameters with skills to be loaded.
+
+ - `id: optional string`
+
+ Container id
+
+ - `skills: optional array of BetaSkillParams`
+
+ List of skills to load in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: optional string`
+
+ Skill version or 'latest' for most recent version
+
+### Beta Container Upload Block
+
+- `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+### Beta Container Upload Block Param
+
+- `beta_container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Content Block
+
+- `beta_content_block: BetaTextBlock or BetaThinkingBlock or BetaRedactedThinkingBlock or 12 more`
+
+ Response model for a file uploaded to the container.
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+### Beta Content Block Param
+
+- `beta_content_block_param: BetaTextBlockParam or BetaImageBlockParam or BetaRequestDocumentBlock or 16 more`
+
+ Regular text content.
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 2 more`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+ - `beta_server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of BetaWebSearchResultBlockParam or BetaWebSearchToolRequestError`
+
+ - `Result Block: array of BetaWebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
+
+ - `beta_web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaCodeExecutionToolResultErrorParam or BetaCodeExecutionResultBlockParam or BetaEncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
+
+ - `beta_bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `beta_text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `beta_text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `beta_text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
+
+ - `beta_tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_mcp_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_request_mcp_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional string or array of BetaTextBlockParam`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_param_content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `is_error: optional boolean`
+
+ - `beta_container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_compaction_block_param: object { content, type, cache_control }`
+
+ A compaction block containing summary of previous context.
+
+ Users should round-trip these blocks from responses to subsequent requests
+ to maintain context across compaction boundaries.
+
+ When content is None, the block represents a failed compaction. The server
+ treats these as no-ops. Empty string content is not allowed.
+
+ - `content: string`
+
+ Summary of previously compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Content Block Source
+
+- `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+### Beta Content Block Source Content
+
+- `beta_content_block_source_content: BetaTextBlockParam or BetaImageBlockParam`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Context Management Config
+
+- `beta_context_management_config: object { edits }`
+
+ - `edits: optional array of BetaClearToolUses20250919Edit or BetaClearThinking20251015Edit or BetaCompact20260112Edit`
+
+ List of context management edits to apply
+
+ - `beta_clear_tool_uses_20250919_edit: object { type, clear_at_least, clear_tool_inputs, 3 more }`
+
+ - `type: "clear_tool_uses_20250919"`
+
+ - `clear_at_least: optional object { type, value }`
+
+ Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+ - `clear_tool_inputs: optional boolean or array of string`
+
+ Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
+
+ - `union_member_0: boolean`
+
+ - `union_member_1: array of string`
+
+ - `exclude_tools: optional array of string`
+
+ Tool names whose uses are preserved from clearing
+
+ - `keep: optional object { type, value }`
+
+ Number of tool uses to retain in the conversation
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+ - `trigger: optional BetaInputTokensTrigger or BetaToolUsesTrigger`
+
+ Condition that triggers the context management strategy
+
+ - `beta_input_tokens_trigger: object { type, value }`
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+ - `beta_tool_uses_trigger: object { type, value }`
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+ - `beta_clear_thinking_20251015_edit: object { type, keep }`
+
+ - `type: "clear_thinking_20251015"`
+
+ - `keep: optional BetaThinkingTurns or BetaAllThinkingTurns or "all"`
+
+ Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
+
+ - `beta_thinking_turns: object { type, value }`
+
+ - `type: "thinking_turns"`
+
+ - `value: number`
+
+ - `beta_all_thinking_turns: object { type }`
+
+ - `type: "all"`
+
+ - `union_member_2: "all"`
+
+ - `beta_compact_20260112_edit: object { type, instructions, pause_after_compaction, trigger }`
+
+ Automatically compact older context when reaching the configured trigger threshold.
+
+ - `type: "compact_20260112"`
+
+ - `instructions: optional string`
+
+ Additional instructions for summarization.
+
+ - `pause_after_compaction: optional boolean`
+
+ Whether to pause after compaction and return the compaction block to the user.
+
+ - `trigger: optional object { type, value }`
+
+ When to trigger compaction. Defaults to 150000 input tokens.
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+### Beta Context Management Response
+
+- `beta_context_management_response: object { applied_edits }`
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+### Beta Count Tokens Context Management Response
+
+- `beta_count_tokens_context_management_response: object { original_input_tokens }`
+
+ - `original_input_tokens: number`
+
+ The original token count before context management was applied
+
+### Beta Direct Caller
+
+- `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+### Beta Document Block
+
+- `beta_document_block: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+### Beta Encrypted Code Execution Result Block
+
+- `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Beta Encrypted Code Execution Result Block Param
+
+- `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Beta File Document Source
+
+- `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+### Beta File Image Source
+
+- `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+### Beta Image Block Param
+
+- `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Input JSON Delta
+
+- `beta_input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+### Beta Input Tokens Clear At Least
+
+- `beta_input_tokens_clear_at_least: object { type, value }`
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+### Beta Input Tokens Trigger
+
+- `beta_input_tokens_trigger: object { type, value }`
+
+ - `type: "input_tokens"`
+
+ - `value: number`
+
+### Beta Iterations Usage
+
+- `beta_iterations_usage: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+### Beta JSON Output Format
+
+- `beta_json_output_format: object { schema, type }`
+
+ - `schema: map[unknown]`
+
+ The JSON schema of the format
+
+ - `type: "json_schema"`
+
+### Beta MCP Tool Config
+
+- `beta_mcp_tool_config: object { defer_loading, enabled }`
+
+ Configuration for a specific tool in an MCP toolset.
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+### Beta MCP Tool Default Config
+
+- `beta_mcp_tool_default_config: object { defer_loading, enabled }`
+
+ Default configuration for tools in an MCP toolset.
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+### Beta MCP Tool Result Block
+
+- `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+### Beta MCP Tool Use Block
+
+- `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+### Beta MCP Tool Use Block Param
+
+- `beta_mcp_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta MCP Toolset
+
+- `beta_mcp_toolset: object { mcp_server_name, type, cache_control, 2 more }`
+
+ Configuration for a group of tools from an MCP server.
+
+ Allows configuring enabled status and defer_loading for all tools
+ from an MCP server, with optional per-tool overrides.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server to configure tools for
+
+ - `type: "mcp_toolset"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `configs: optional map[BetaMCPToolConfig]`
+
+ Configuration overrides for specific tools, keyed by tool name
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+ - `default_config: optional object { defer_loading, enabled }`
+
+ Default configuration applied to all tools from this server
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+### Beta Memory Tool 20250818
+
+- `beta_memory_tool_20250818: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "memory"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "memory_20250818"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Memory Tool 20250818 Command
+
+- `beta_memory_tool_20250818_command: BetaMemoryTool20250818ViewCommand or BetaMemoryTool20250818CreateCommand or BetaMemoryTool20250818StrReplaceCommand or 3 more`
+
+ - `beta_memory_tool_20250818_view_command: object { command, path, view_range }`
+
+ - `command: "view"`
+
+ Command type identifier
+
+ - `path: string`
+
+ Path to directory or file to view
+
+ - `view_range: optional array of number`
+
+ Optional line range for viewing specific lines
+
+ - `beta_memory_tool_20250818_create_command: object { command, file_text, path }`
+
+ - `command: "create"`
+
+ Command type identifier
+
+ - `file_text: string`
+
+ Content to write to the file
+
+ - `path: string`
+
+ Path where the file should be created
+
+ - `beta_memory_tool_20250818_str_replace_command: object { command, new_str, old_str, path }`
+
+ - `command: "str_replace"`
+
+ Command type identifier
+
+ - `new_str: string`
+
+ Text to replace with
+
+ - `old_str: string`
+
+ Text to search for and replace
+
+ - `path: string`
+
+ Path to the file where text should be replaced
+
+ - `beta_memory_tool_20250818_insert_command: object { command, insert_line, insert_text, path }`
+
+ - `command: "insert"`
+
+ Command type identifier
+
+ - `insert_line: number`
+
+ Line number where text should be inserted
+
+ - `insert_text: string`
+
+ Text to insert at the specified line
+
+ - `path: string`
+
+ Path to the file where text should be inserted
+
+ - `beta_memory_tool_20250818_delete_command: object { command, path }`
+
+ - `command: "delete"`
+
+ Command type identifier
+
+ - `path: string`
+
+ Path to the file or directory to delete
+
+ - `beta_memory_tool_20250818_rename_command: object { command, new_path, old_path }`
+
+ - `command: "rename"`
+
+ Command type identifier
+
+ - `new_path: string`
+
+ New path for the file or directory
+
+ - `old_path: string`
+
+ Current path of the file or directory
+
+### Beta Memory Tool 20250818 Create Command
+
+- `beta_memory_tool_20250818_create_command: object { command, file_text, path }`
+
+ - `command: "create"`
+
+ Command type identifier
+
+ - `file_text: string`
+
+ Content to write to the file
+
+ - `path: string`
+
+ Path where the file should be created
+
+### Beta Memory Tool 20250818 Delete Command
+
+- `beta_memory_tool_20250818_delete_command: object { command, path }`
+
+ - `command: "delete"`
+
+ Command type identifier
+
+ - `path: string`
+
+ Path to the file or directory to delete
+
+### Beta Memory Tool 20250818 Insert Command
+
+- `beta_memory_tool_20250818_insert_command: object { command, insert_line, insert_text, path }`
+
+ - `command: "insert"`
+
+ Command type identifier
+
+ - `insert_line: number`
+
+ Line number where text should be inserted
+
+ - `insert_text: string`
+
+ Text to insert at the specified line
+
+ - `path: string`
+
+ Path to the file where text should be inserted
+
+### Beta Memory Tool 20250818 Rename Command
+
+- `beta_memory_tool_20250818_rename_command: object { command, new_path, old_path }`
+
+ - `command: "rename"`
+
+ Command type identifier
+
+ - `new_path: string`
+
+ New path for the file or directory
+
+ - `old_path: string`
+
+ Current path of the file or directory
+
+### Beta Memory Tool 20250818 Str Replace Command
+
+- `beta_memory_tool_20250818_str_replace_command: object { command, new_str, old_str, path }`
+
+ - `command: "str_replace"`
+
+ Command type identifier
+
+ - `new_str: string`
+
+ Text to replace with
+
+ - `old_str: string`
+
+ Text to search for and replace
+
+ - `path: string`
+
+ Path to the file where text should be replaced
+
+### Beta Memory Tool 20250818 View Command
+
+- `beta_memory_tool_20250818_view_command: object { command, path, view_range }`
+
+ - `command: "view"`
+
+ Command type identifier
+
+ - `path: string`
+
+ Path to directory or file to view
+
+ - `view_range: optional array of number`
+
+ Optional line range for viewing specific lines
+
+### Beta Message
+
+- `beta_message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Message Delta Usage
+
+- `beta_message_delta_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 3 more }`
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Beta Message Iteration Usage
+
+- `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+### Beta Message Param
+
+- `beta_message_param: object { content, role }`
+
+ - `content: array of BetaContentBlockParam`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 2 more`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+ - `beta_server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of BetaWebSearchResultBlockParam or BetaWebSearchToolRequestError`
+
+ - `Result Block: array of BetaWebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
+
+ - `beta_web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaCodeExecutionToolResultErrorParam or BetaCodeExecutionResultBlockParam or BetaEncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaBashCodeExecutionToolResultErrorParam or BetaBashCodeExecutionResultBlockParam`
+
+ - `beta_bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `beta_text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `beta_text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `beta_text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
+
+ - `beta_tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_mcp_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_request_mcp_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional string or array of BetaTextBlockParam`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_param_content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `is_error: optional boolean`
+
+ - `beta_container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_compaction_block_param: object { content, type, cache_control }`
+
+ A compaction block containing summary of previous context.
+
+ Users should round-trip these blocks from responses to subsequent requests
+ to maintain context across compaction boundaries.
+
+ When content is None, the block represents a failed compaction. The server
+ treats these as no-ops. Empty string content is not allowed.
+
+ - `content: string`
+
+ Summary of previously compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `role: "user" or "assistant"`
+
+ - `"user"`
+
+ - `"assistant"`
+
+### Beta Message Tokens Count
+
+- `beta_message_tokens_count: object { context_management, input_tokens }`
+
+ - `context_management: object { original_input_tokens }`
+
+ Information about context management applied to the message.
+
+ - `original_input_tokens: number`
+
+ The original token count before context management was applied
+
+ - `input_tokens: number`
+
+ The total number of tokens across the provided list of messages, system prompt, and tools.
+
+### Beta Metadata
+
+- `beta_metadata: object { user_id }`
+
+ - `user_id: optional string`
+
+ An external identifier for the user who is associated with the request.
+
+ This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
+
+### Beta Output Config
+
+- `beta_output_config: object { effort, format }`
+
+ - `effort: optional "low" or "medium" or "high" or "max"`
+
+ All possible effort levels.
+
+ - `"low"`
+
+ - `"medium"`
+
+ - `"high"`
+
+ - `"max"`
+
+ - `format: optional object { schema, type }`
+
+ A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ - `schema: map[unknown]`
+
+ The JSON schema of the format
+
+ - `type: "json_schema"`
+
+### Beta Plain Text Source
+
+- `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+### Beta Raw Content Block Delta
+
+- `beta_raw_content_block_delta: BetaTextDelta or BetaInputJSONDelta or BetaCitationsDelta or 3 more`
+
+ - `beta_text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `beta_input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `beta_citations_delta: object { citation, type }`
+
+ - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `beta_thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `beta_signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+ - `beta_compaction_content_block_delta: object { content, type }`
+
+ - `content: string`
+
+ - `type: "compaction_delta"`
+
+### Beta Raw Content Block Delta Event
+
+- `beta_raw_content_block_delta_event: object { delta, index, type }`
+
+ - `delta: BetaTextDelta or BetaInputJSONDelta or BetaCitationsDelta or 3 more`
+
+ - `beta_text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `beta_input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `beta_citations_delta: object { citation, type }`
+
+ - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `beta_thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `beta_signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+ - `beta_compaction_content_block_delta: object { content, type }`
+
+ - `content: string`
+
+ - `type: "compaction_delta"`
+
+ - `index: number`
+
+ - `type: "content_block_delta"`
+
+### Beta Raw Content Block Start Event
+
+- `beta_raw_content_block_start_event: object { content_block, index, type }`
+
+ - `content_block: BetaTextBlock or BetaThinkingBlock or BetaRedactedThinkingBlock or 12 more`
+
+ Response model for a file uploaded to the container.
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `index: number`
+
+ - `type: "content_block_start"`
+
+### Beta Raw Content Block Stop Event
+
+- `beta_raw_content_block_stop_event: object { index, type }`
+
+ - `index: number`
+
+ - `type: "content_block_stop"`
+
+### Beta Raw Message Delta Event
+
+- `beta_raw_message_delta_event: object { context_management, delta, type, usage }`
+
+ - `context_management: object { applied_edits }`
+
+ Information about context management strategies applied during the request
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `delta: object { container, stop_details, stop_reason, stop_sequence }`
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ - `type: "message_delta"`
+
+ - `usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 3 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Beta Raw Message Start Event
+
+- `beta_raw_message_start_event: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "message_start"`
+
+### Beta Raw Message Stop Event
+
+- `beta_raw_message_stop_event: object { type }`
+
+ - `type: "message_stop"`
+
+### Beta Raw Message Stream Event
+
+- `beta_raw_message_stream_event: BetaRawMessageStartEvent or BetaRawMessageDeltaEvent or BetaRawMessageStopEvent or 3 more`
+
+ - `beta_raw_message_start_event: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "message_start"`
+
+ - `beta_raw_message_delta_event: object { context_management, delta, type, usage }`
+
+ - `context_management: object { applied_edits }`
+
+ Information about context management strategies applied during the request
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `delta: object { container, stop_details, stop_reason, stop_sequence }`
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ - `type: "message_delta"`
+
+ - `usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 3 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `beta_raw_message_stop_event: object { type }`
+
+ - `type: "message_stop"`
+
+ - `beta_raw_content_block_start_event: object { content_block, index, type }`
+
+ - `content_block: BetaTextBlock or BetaThinkingBlock or BetaRedactedThinkingBlock or 12 more`
+
+ Response model for a file uploaded to the container.
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `index: number`
+
+ - `type: "content_block_start"`
+
+ - `beta_raw_content_block_delta_event: object { delta, index, type }`
+
+ - `delta: BetaTextDelta or BetaInputJSONDelta or BetaCitationsDelta or 3 more`
+
+ - `beta_text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `beta_input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `beta_citations_delta: object { citation, type }`
+
+ - `citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `beta_thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `beta_signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+ - `beta_compaction_content_block_delta: object { content, type }`
+
+ - `content: string`
+
+ - `type: "compaction_delta"`
+
+ - `index: number`
+
+ - `type: "content_block_delta"`
+
+ - `beta_raw_content_block_stop_event: object { index, type }`
+
+ - `index: number`
+
+ - `type: "content_block_stop"`
+
+### Beta Redacted Thinking Block
+
+- `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+### Beta Redacted Thinking Block Param
+
+- `beta_redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+### Beta Refusal Stop Details
+
+- `beta_refusal_stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+### Beta Request Document Block
+
+- `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+### Beta Request MCP Server Tool Configuration
+
+- `beta_request_mcp_server_tool_configuration: object { allowed_tools, enabled }`
+
+ - `allowed_tools: optional array of string`
+
+ - `enabled: optional boolean`
+
+### Beta Request MCP Server URL Definition
+
+- `beta_request_mcp_server_url_definition: object { name, type, url, 2 more }`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `authorization_token: optional string`
+
+ - `tool_configuration: optional object { allowed_tools, enabled }`
+
+ - `allowed_tools: optional array of string`
+
+ - `enabled: optional boolean`
+
+### Beta Request MCP Tool Result Block Param
+
+- `beta_request_mcp_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional string or array of BetaTextBlockParam`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_param_content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `is_error: optional boolean`
+
+### Beta Search Result Block Param
+
+- `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+### Beta Server Tool Caller
+
+- `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+### Beta Server Tool Caller 20260120
+
+- `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Server Tool Usage
+
+- `beta_server_tool_usage: object { web_fetch_requests, web_search_requests }`
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Beta Server Tool Use Block
+
+- `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Server Tool Use Block Param
+
+- `beta_server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Signature Delta
+
+- `beta_signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+### Beta Skill
+
+- `beta_skill: object { skill_id, type, version }`
+
+ A skill that was loaded in a container (response model).
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+### Beta Skill Params
+
+- `beta_skill_params: object { skill_id, type, version }`
+
+ Specification for a skill to be loaded in a container (request model).
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: optional string`
+
+ Skill version or 'latest' for most recent version
+
+### Beta Stop Reason
+
+- `beta_stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+### Beta Text Block
+
+- `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+### Beta Text Block Param
+
+- `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Text Citation
+
+- `beta_text_citation: BetaCitationCharLocation or BetaCitationPageLocation or BetaCitationContentBlockLocation or 2 more`
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Text Citation Param
+
+- `beta_text_citation_param: BetaCitationCharLocationParam or BetaCitationPageLocationParam or BetaCitationContentBlockLocationParam or 2 more`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Beta Text Delta
+
+- `beta_text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+### Beta Text Editor Code Execution Create Result Block
+
+- `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+### Beta Text Editor Code Execution Create Result Block Param
+
+- `beta_text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+### Beta Text Editor Code Execution Str Replace Result Block
+
+- `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+### Beta Text Editor Code Execution Str Replace Result Block Param
+
+- `beta_text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+### Beta Text Editor Code Execution Tool Result Block
+
+- `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+### Beta Text Editor Code Execution Tool Result Block Param
+
+- `beta_text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultErrorParam or BetaTextEditorCodeExecutionViewResultBlockParam or BetaTextEditorCodeExecutionCreateResultBlockParam or BetaTextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `beta_text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `beta_text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `beta_text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Text Editor Code Execution Tool Result Error
+
+- `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+### Beta Text Editor Code Execution Tool Result Error Param
+
+- `beta_text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+### Beta Text Editor Code Execution View Result Block
+
+- `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+### Beta Text Editor Code Execution View Result Block Param
+
+- `beta_text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+### Beta Thinking Block
+
+- `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+### Beta Thinking Block Param
+
+- `beta_thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+### Beta Thinking Config Adaptive
+
+- `beta_thinking_config_adaptive: object { type, display }`
+
+ - `type: "adaptive"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Beta Thinking Config Disabled
+
+- `beta_thinking_config_disabled: object { type }`
+
+ - `type: "disabled"`
+
+### Beta Thinking Config Enabled
+
+- `beta_thinking_config_enabled: object { budget_tokens, type, display }`
+
+ - `budget_tokens: number`
+
+ Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
+
+ Must be ≥1024 and less than `max_tokens`.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `type: "enabled"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Beta Thinking Config Param
+
+- `beta_thinking_config_param: BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive`
+
+ Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `beta_thinking_config_enabled: object { budget_tokens, type, display }`
+
+ - `budget_tokens: number`
+
+ Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
+
+ Must be ≥1024 and less than `max_tokens`.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `type: "enabled"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+ - `beta_thinking_config_disabled: object { type }`
+
+ - `type: "disabled"`
+
+ - `beta_thinking_config_adaptive: object { type, display }`
+
+ - `type: "adaptive"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Beta Thinking Delta
+
+- `beta_thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+### Beta Thinking Turns
+
+- `beta_thinking_turns: object { type, value }`
+
+ - `type: "thinking_turns"`
+
+ - `value: number`
+
+### Beta Tool
+
+- `beta_tool: object { input_schema, name, allowed_callers, 7 more }`
+
+ - `input_schema: object { type, properties, required }`
+
+ [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
+
+ This defines the shape of the `input` that your tool accepts and that the model will produce.
+
+ - `type: "object"`
+
+ - `properties: optional map[unknown]`
+
+ - `required: optional array of string`
+
+ - `name: string`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `description: optional string`
+
+ Description of what this tool does.
+
+ Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
+
+ - `eager_input_streaming: optional boolean`
+
+ Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `type: optional "custom"`
+
+ - `"custom"`
+
+### Beta Tool Bash 20241022
+
+- `beta_tool_bash_20241022: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Bash 20250124
+
+- `beta_tool_bash_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Choice
+
+- `beta_tool_choice: BetaToolChoiceAuto or BetaToolChoiceAny or BetaToolChoiceTool or BetaToolChoiceNone`
+
+ How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+ - `beta_tool_choice_auto: object { type, disable_parallel_tool_use }`
+
+ The model will automatically decide whether to use tools.
+
+ - `type: "auto"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output at most one tool use.
+
+ - `beta_tool_choice_any: object { type, disable_parallel_tool_use }`
+
+ The model will use any available tools.
+
+ - `type: "any"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+ - `beta_tool_choice_tool: object { name, type, disable_parallel_tool_use }`
+
+ The model will use the specified tool with `tool_choice.name`.
+
+ - `name: string`
+
+ The name of the tool to use.
+
+ - `type: "tool"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+ - `beta_tool_choice_none: object { type }`
+
+ The model will not be allowed to use tools.
+
+ - `type: "none"`
+
+### Beta Tool Choice Any
+
+- `beta_tool_choice_any: object { type, disable_parallel_tool_use }`
+
+ The model will use any available tools.
+
+ - `type: "any"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+### Beta Tool Choice Auto
+
+- `beta_tool_choice_auto: object { type, disable_parallel_tool_use }`
+
+ The model will automatically decide whether to use tools.
+
+ - `type: "auto"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output at most one tool use.
+
+### Beta Tool Choice None
+
+- `beta_tool_choice_none: object { type }`
+
+ The model will not be allowed to use tools.
+
+ - `type: "none"`
+
+### Beta Tool Choice Tool
+
+- `beta_tool_choice_tool: object { name, type, disable_parallel_tool_use }`
+
+ The model will use the specified tool with `tool_choice.name`.
+
+ - `name: string`
+
+ The name of the tool to use.
+
+ - `type: "tool"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+### Beta Tool Computer Use 20241022
+
+- `beta_tool_computer_use_20241022: object { display_height_px, display_width_px, name, 7 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Computer Use 20250124
+
+- `beta_tool_computer_use_20250124: object { display_height_px, display_width_px, name, 7 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Computer Use 20251124
+
+- `beta_tool_computer_use_20251124: object { display_height_px, display_width_px, name, 8 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20251124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `enable_zoom: optional boolean`
+
+ Whether to enable an action to take a zoomed-in screenshot of the screen.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Reference Block
+
+- `beta_tool_reference_block: object { tool_name, type }`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+### Beta Tool Reference Block Param
+
+- `beta_tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Tool Result Block Param
+
+- `beta_tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of BetaTextBlockParam or BetaImageBlockParam or BetaSearchResultBlockParam or 2 more`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `beta_search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of BetaTextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `beta_request_document_block: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `beta_tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+### Beta Tool Search Tool Bm25 20251119
+
+- `beta_tool_search_tool_bm25_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_bm25"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
+
+ - `"tool_search_tool_bm25_20251119"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Search Tool Regex 20251119
+
+- `beta_tool_search_tool_regex_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_regex"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
+
+ - `"tool_search_tool_regex_20251119"`
+
+ - `"tool_search_tool_regex"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Search Tool Result Block
+
+- `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+### Beta Tool Search Tool Result Block Param
+
+- `beta_tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BetaToolSearchToolResultErrorParam or BetaToolSearchToolSearchResultBlockParam`
+
+ - `beta_tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Beta Tool Search Tool Result Error
+
+- `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+### Beta Tool Search Tool Result Error Param
+
+- `beta_tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+### Beta Tool Search Tool Search Result Block
+
+- `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+### Beta Tool Search Tool Search Result Block Param
+
+- `beta_tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+### Beta Tool Text Editor 20241022
+
+- `beta_tool_text_editor_20241022: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Text Editor 20250124
+
+- `beta_tool_text_editor_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Text Editor 20250429
+
+- `beta_tool_text_editor_20250429: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250429"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Text Editor 20250728
+
+- `beta_tool_text_editor_20250728: object { name, type, allowed_callers, 5 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250728"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `max_characters: optional number`
+
+ Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Tool Union
+
+- `beta_tool_union: BetaTool or BetaToolBash20241022 or BetaToolBash20250124 or 19 more`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `beta_tool: object { input_schema, name, allowed_callers, 7 more }`
+
+ - `input_schema: object { type, properties, required }`
+
+ [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
+
+ This defines the shape of the `input` that your tool accepts and that the model will produce.
+
+ - `type: "object"`
+
+ - `properties: optional map[unknown]`
+
+ - `required: optional array of string`
+
+ - `name: string`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `description: optional string`
+
+ Description of what this tool does.
+
+ Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
+
+ - `eager_input_streaming: optional boolean`
+
+ Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `type: optional "custom"`
+
+ - `"custom"`
+
+ - `beta_tool_bash_20241022: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_bash_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_code_execution_tool_20250522: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250522"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_code_execution_tool_20250825: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250825"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_code_execution_tool_20260120: object { name, type, allowed_callers, 3 more }`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20260120"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_computer_use_20241022: object { display_height_px, display_width_px, name, 7 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_memory_tool_20250818: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "memory"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "memory_20250818"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_computer_use_20250124: object { display_height_px, display_width_px, name, 7 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_text_editor_20241022: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20241022"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_computer_use_20251124: object { display_height_px, display_width_px, name, 8 more }`
+
+ - `display_height_px: number`
+
+ The height of the display in pixels.
+
+ - `display_width_px: number`
+
+ The width of the display in pixels.
+
+ - `name: "computer"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "computer_20251124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `display_number: optional number`
+
+ The X11 display number (e.g. 0, 1) for the display.
+
+ - `enable_zoom: optional boolean`
+
+ Whether to enable an action to take a zoomed-in screenshot of the screen.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_text_editor_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_text_editor_20250429: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250429"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_text_editor_20250728: object { name, type, allowed_callers, 5 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250728"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `max_characters: optional number`
+
+ Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_web_search_tool_20250305: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20250305"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+ - `beta_web_fetch_tool_20250910: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20250910"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_web_search_tool_20260209: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+ - `beta_web_fetch_tool_20260209: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_web_fetch_tool_20260309: object { name, type, allowed_callers, 9 more }`
+
+ Web fetch tool with use_cache parameter for bypassing cached content.
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260309"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `use_cache: optional boolean`
+
+ Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
+
+ - `beta_tool_search_tool_bm25_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_bm25"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
+
+ - `"tool_search_tool_bm25_20251119"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_tool_search_tool_regex_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_regex"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
+
+ - `"tool_search_tool_regex_20251119"`
+
+ - `"tool_search_tool_regex"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `beta_mcp_toolset: object { mcp_server_name, type, cache_control, 2 more }`
+
+ Configuration for a group of tools from an MCP server.
+
+ Allows configuring enabled status and defer_loading for all tools
+ from an MCP server, with optional per-tool overrides.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server to configure tools for
+
+ - `type: "mcp_toolset"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `configs: optional map[BetaMCPToolConfig]`
+
+ Configuration overrides for specific tools, keyed by tool name
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+ - `default_config: optional object { defer_loading, enabled }`
+
+ Default configuration applied to all tools from this server
+
+ - `defer_loading: optional boolean`
+
+ - `enabled: optional boolean`
+
+### Beta Tool Use Block
+
+- `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Tool Use Block Param
+
+- `beta_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Tool Uses Keep
+
+- `beta_tool_uses_keep: object { type, value }`
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+### Beta Tool Uses Trigger
+
+- `beta_tool_uses_trigger: object { type, value }`
+
+ - `type: "tool_uses"`
+
+ - `value: number`
+
+### Beta URL Image Source
+
+- `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+### Beta URL PDF Source
+
+- `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+### Beta Usage
+
+- `beta_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta User Location
+
+- `beta_user_location: object { type, city, country, 2 more }`
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Beta Web Fetch Block
+
+- `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+### Beta Web Fetch Block Param
+
+- `beta_web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+### Beta Web Fetch Tool 20250910
+
+- `beta_web_fetch_tool_20250910: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20250910"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Web Fetch Tool 20260209
+
+- `beta_web_fetch_tool_20260209: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Beta Web Fetch Tool 20260309
+
+- `beta_web_fetch_tool_20260309: object { name, type, allowed_callers, 9 more }`
+
+ Web fetch tool with use_cache parameter for bypassing cached content.
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260309"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `use_cache: optional boolean`
+
+ Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
+
+### Beta Web Fetch Tool Result Block
+
+- `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Web Fetch Tool Result Block Param
+
+- `beta_web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: BetaWebFetchToolResultErrorBlockParam or BetaWebFetchBlockParam`
+
+ - `beta_web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource or BetaContentBlockSource or 2 more`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `beta_content_block_source: object { content, type }`
+
+ - `content: string or array of BetaContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `beta_content_block_source_content: array of BetaContentBlockSourceContent`
+
+ - `beta_text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of BetaTextCitationParam`
+
+ - `beta_citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `beta_image_block_param: object { source, type, cache_control }`
+
+ - `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
+
+ - `beta_base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `beta_url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_image_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `beta_url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `beta_file_document_source: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "file"`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Web Fetch Tool Result Error Block
+
+- `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+### Beta Web Fetch Tool Result Error Block Param
+
+- `beta_web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+### Beta Web Fetch Tool Result Error Code
+
+- `beta_web_fetch_tool_result_error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+### Beta Web Search Result Block
+
+- `beta_web_search_result_block: object { encrypted_content, page_age, title, 2 more }`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+### Beta Web Search Result Block Param
+
+- `beta_web_search_result_block_param: object { encrypted_content, title, type, 2 more }`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+### Beta Web Search Tool 20250305
+
+- `beta_web_search_tool_20250305: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20250305"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Beta Web Search Tool 20260209
+
+- `beta_web_search_tool_20260209: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Beta Web Search Tool Request Error
+
+- `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Beta Web Search Tool Result Block
+
+- `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Web Search Tool Result Block Content
+
+- `beta_web_search_tool_result_block_content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+### Beta Web Search Tool Result Block Param
+
+- `beta_web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of BetaWebSearchResultBlockParam or BetaWebSearchToolRequestError`
+
+ - `Result Block: array of BetaWebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Beta Web Search Tool Result Block Param Content
+
+- `beta_web_search_tool_result_block_param_content: array of BetaWebSearchResultBlockParam or BetaWebSearchToolRequestError`
+
+ - `Result Block: array of BetaWebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `beta_web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Beta Web Search Tool Result Error
+
+- `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Beta Web Search Tool Result Error Code
+
+- `beta_web_search_tool_result_error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+# Batches
+
+## Create
+
+`$ ant beta:messages:batches create`
+
+**post** `/v1/messages/batches`
+
+Send a batch of Message creation requests.
+
+The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--request: array of object { custom_id, params }`
+
+ Body param: List of requests for prompt completion. Each is an individual request to create a Message.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches create \
+ --api-key my-anthropic-api-key \
+ --request '{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text}], role: user}], model: claude-opus-4-6}}'
+```
+
+## Retrieve
+
+`$ ant beta:messages:batches retrieve`
+
+**get** `/v1/messages/batches/{message_batch_id}`
+
+This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches retrieve \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## List
+
+`$ ant beta:messages:batches list`
+
+**get** `/v1/messages/batches`
+
+List all Message Batches within a Workspace. Most recently created batches are returned first.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListResponse_MessageBatch_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of BetaMessageBatch`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant beta:messages:batches list \
+ --api-key my-anthropic-api-key
+```
+
+## Cancel
+
+`$ ant beta:messages:batches cancel`
+
+**post** `/v1/messages/batches/{message_batch_id}/cancel`
+
+Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
+
+The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches cancel \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Delete
+
+`$ ant beta:messages:batches delete`
+
+**delete** `/v1/messages/batches/{message_batch_id}`
+
+Delete a Message Batch.
+
+Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Example
+
+```cli
+ant beta:messages:batches delete \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Results
+
+`$ ant beta:messages:batches results`
+
+**get** `/v1/messages/batches/{message_batch_id}/results`
+
+Streams the results of a Message Batch as a `.jsonl` file.
+
+Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Example
+
+```cli
+ant beta:messages:batches results \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Domain Types
+
+### Beta Deleted Message Batch
+
+- `beta_deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Beta Message Batch
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Beta Message Batch Canceled Result
+
+- `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+### Beta Message Batch Errored Result
+
+- `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+### Beta Message Batch Expired Result
+
+- `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Individual Response
+
+- `beta_message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Request Counts
+
+- `beta_message_batch_request_counts: object { canceled, errored, expired, 2 more }`
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+### Beta Message Batch Result
+
+- `beta_message_batch_result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Succeeded Result
+
+- `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
diff --git a/content/en/api/cli/beta/messages/batches.md b/content/en/api/cli/beta/messages/batches.md
index 21907b0d4..337681201 100644
--- a/content/en/api/cli/beta/messages/batches.md
+++ b/content/en/api/cli/beta/messages/batches.md
@@ -1 +1,5402 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Batches
+
+## Create
+
+`$ ant beta:messages:batches create`
+
+**post** `/v1/messages/batches`
+
+Send a batch of Message creation requests.
+
+The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--request: array of object { custom_id, params }`
+
+ Body param: List of requests for prompt completion. Each is an individual request to create a Message.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches create \
+ --api-key my-anthropic-api-key \
+ --request '{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text}], role: user}], model: claude-opus-4-6}}'
+```
+
+## Retrieve
+
+`$ ant beta:messages:batches retrieve`
+
+**get** `/v1/messages/batches/{message_batch_id}`
+
+This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches retrieve \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## List
+
+`$ ant beta:messages:batches list`
+
+**get** `/v1/messages/batches`
+
+List all Message Batches within a Workspace. Most recently created batches are returned first.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListResponse_MessageBatch_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of BetaMessageBatch`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant beta:messages:batches list \
+ --api-key my-anthropic-api-key
+```
+
+## Cancel
+
+`$ ant beta:messages:batches cancel`
+
+**post** `/v1/messages/batches/{message_batch_id}/cancel`
+
+Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
+
+The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches cancel \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Delete
+
+`$ ant beta:messages:batches delete`
+
+**delete** `/v1/messages/batches/{message_batch_id}`
+
+Delete a Message Batch.
+
+Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Example
+
+```cli
+ant beta:messages:batches delete \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Results
+
+`$ ant beta:messages:batches results`
+
+**get** `/v1/messages/batches/{message_batch_id}/results`
+
+Streams the results of a Message Batch as a `.jsonl` file.
+
+Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Example
+
+```cli
+ant beta:messages:batches results \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Domain Types
+
+### Beta Deleted Message Batch
+
+- `beta_deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Beta Message Batch
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Beta Message Batch Canceled Result
+
+- `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+### Beta Message Batch Errored Result
+
+- `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+### Beta Message Batch Expired Result
+
+- `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Individual Response
+
+- `beta_message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Request Counts
+
+- `beta_message_batch_request_counts: object { canceled, errored, expired, 2 more }`
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+### Beta Message Batch Result
+
+- `beta_message_batch_result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Beta Message Batch Succeeded Result
+
+- `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
diff --git a/content/en/api/cli/beta/messages/batches/cancel.md b/content/en/api/cli/beta/messages/batches/cancel.md
index 34f803607..d35ceb563 100644
--- a/content/en/api/cli/beta/messages/batches/cancel.md
+++ b/content/en/api/cli/beta/messages/batches/cancel.md
@@ -1 +1,117 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Cancel
+
+`$ ant beta:messages:batches cancel`
+
+**post** `/v1/messages/batches/{message_batch_id}/cancel`
+
+Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
+
+The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches cancel \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
diff --git a/content/en/api/cli/beta/messages/batches/create.md b/content/en/api/cli/beta/messages/batches/create.md
index e7133e01b..6484771fb 100644
--- a/content/en/api/cli/beta/messages/batches/create.md
+++ b/content/en/api/cli/beta/messages/batches/create.md
@@ -1 +1,117 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Create
+
+`$ ant beta:messages:batches create`
+
+**post** `/v1/messages/batches`
+
+Send a batch of Message creation requests.
+
+The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--request: array of object { custom_id, params }`
+
+ Body param: List of requests for prompt completion. Each is an individual request to create a Message.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches create \
+ --api-key my-anthropic-api-key \
+ --request '{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text}], role: user}], model: claude-opus-4-6}}'
+```
diff --git a/content/en/api/cli/beta/messages/batches/delete.md b/content/en/api/cli/beta/messages/batches/delete.md
index 09246687f..12b3f5b4d 100644
--- a/content/en/api/cli/beta/messages/batches/delete.md
+++ b/content/en/api/cli/beta/messages/batches/delete.md
@@ -1 +1,43 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Delete
+
+`$ ant beta:messages:batches delete`
+
+**delete** `/v1/messages/batches/{message_batch_id}`
+
+Delete a Message Batch.
+
+Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Example
+
+```cli
+ant beta:messages:batches delete \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
diff --git a/content/en/api/cli/beta/messages/batches/list.md b/content/en/api/cli/beta/messages/batches/list.md
index e6c80d8df..063832a75 100644
--- a/content/en/api/cli/beta/messages/batches/list.md
+++ b/content/en/api/cli/beta/messages/batches/list.md
@@ -1 +1,138 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## List
+
+`$ ant beta:messages:batches list`
+
+**get** `/v1/messages/batches`
+
+List all Message Batches within a Workspace. Most recently created batches are returned first.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListResponse_MessageBatch_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of BetaMessageBatch`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant beta:messages:batches list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/messages/batches/results.md b/content/en/api/cli/beta/messages/batches/results.md
index 41b01b9f6..3e9eb868a 100644
--- a/content/en/api/cli/beta/messages/batches/results.md
+++ b/content/en/api/cli/beta/messages/batches/results.md
@@ -1 +1,1209 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Results
+
+`$ ant beta:messages:batches results`
+
+**get** `/v1/messages/batches/{message_batch_id}/results`
+
+Streams the results of a Message Batch as a `.jsonl` file.
+
+Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: BetaMessageBatchSucceededResult or BetaMessageBatchErroredResult or BetaMessageBatchCanceledResult or BetaMessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `beta_message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `type: "succeeded"`
+
+ - `beta_message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: BetaInvalidRequestError or BetaAuthenticationError or BetaBillingError or 6 more`
+
+ - `beta_invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `beta_authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `beta_billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `beta_permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `beta_not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `beta_rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `beta_gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `beta_api_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `beta_overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `beta_message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `beta_message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Example
+
+```cli
+ant beta:messages:batches results \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
diff --git a/content/en/api/cli/beta/messages/batches/retrieve.md b/content/en/api/cli/beta/messages/batches/retrieve.md
index 99d190af7..6ab5cd4a0 100644
--- a/content/en/api/cli/beta/messages/batches/retrieve.md
+++ b/content/en/api/cli/beta/messages/batches/retrieve.md
@@ -1 +1,115 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Retrieve
+
+`$ ant beta:messages:batches retrieve`
+
+**get** `/v1/messages/batches/{message_batch_id}`
+
+This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant beta:messages:batches retrieve \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
diff --git a/content/en/api/cli/beta/messages/count_tokens.md b/content/en/api/cli/beta/messages/count_tokens.md
index c8646c0dc..3f3116683 100644
--- a/content/en/api/cli/beta/messages/count_tokens.md
+++ b/content/en/api/cli/beta/messages/count_tokens.md
@@ -1 +1,209 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Count Tokens
+
+`$ ant beta:messages count-tokens`
+
+**post** `/v1/messages/count_tokens`
+
+Count the number of tokens in a Message.
+
+The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.
+
+Learn more about token counting in our [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
+
+### Parameters
+
+- `--message: array of BetaMessageParam`
+
+ Body param: Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ Body param: The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Body param: Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--context-management: optional object { edits }`
+
+ Body param: Context management configuration.
+
+ This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.
+
+- `--mcp-server: optional array of BetaRequestMCPServerURLDefinition`
+
+ Body param: MCP servers to be utilized in this request
+
+- `--output-config: optional object { effort, format }`
+
+ Body param: Configuration options for the model's output, such as the output format.
+
+- `--output-format: optional object { schema, type }`
+
+ Body param: Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
+
+- `--speed: optional "standard" or "fast"`
+
+ Body param: The inference speed mode for this request. `"fast"` enables high output-tokens-per-second inference.
+
+- `--system: optional string or array of BetaTextBlockParam`
+
+ Body param: System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive`
+
+ Body param: Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional BetaToolChoiceAuto or BetaToolChoiceAny or BetaToolChoiceTool or BetaToolChoiceNone`
+
+ Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of BetaTool or BetaToolBash20241022 or BetaToolBash20250124 or 19 more`
+
+ Body param: Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message_tokens_count: object { context_management, input_tokens }`
+
+ - `context_management: object { original_input_tokens }`
+
+ Information about context management applied to the message.
+
+ - `original_input_tokens: number`
+
+ The original token count before context management was applied
+
+ - `input_tokens: number`
+
+ The total number of tokens across the provided list of messages, system prompt, and tools.
+
+### Example
+
+```cli
+ant beta:messages count-tokens \
+ --api-key my-anthropic-api-key \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-mythos-preview
+```
diff --git a/content/en/api/cli/beta/messages/create.md b/content/en/api/cli/beta/messages/create.md
index 2ec4bced0..5476cbeef 100644
--- a/content/en/api/cli/beta/messages/create.md
+++ b/content/en/api/cli/beta/messages/create.md
@@ -1 +1,1338 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Create
+
+`$ ant beta:messages create`
+
+**post** `/v1/messages`
+
+Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
+
+The Messages API can be used for either single queries or stateless multi-turn conversations.
+
+Learn more about the Messages API in our [user guide](https://docs.claude.com/en/docs/initial-setup)
+
+### Parameters
+
+- `--max-tokens: number`
+
+ Body param: The maximum number of tokens to generate before stopping.
+
+ Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
+
+ Different models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details.
+
+- `--message: array of BetaMessageParam`
+
+ Body param: Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ Body param: The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Body param: Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--container: optional BetaContainerParams or string`
+
+ Body param: Container identifier for reuse across requests.
+
+- `--context-management: optional object { edits }`
+
+ Body param: Context management configuration.
+
+ This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.
+
+- `--inference-geo: optional string`
+
+ Body param: Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.
+
+- `--mcp-server: optional array of BetaRequestMCPServerURLDefinition`
+
+ Body param: MCP servers to be utilized in this request
+
+- `--metadata: optional object { user_id }`
+
+ Body param: An object describing metadata about the request.
+
+- `--output-config: optional object { effort, format }`
+
+ Body param: Configuration options for the model's output, such as the output format.
+
+- `--output-format: optional object { schema, type }`
+
+ Body param: Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ A schema to specify Claude's output format in responses. This parameter will be removed in a future release.
+
+- `--service-tier: optional "auto" or "standard_only"`
+
+ Body param: Determines whether to use priority capacity (if available) or standard capacity for this request.
+
+ Anthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
+
+- `--speed: optional "standard" or "fast"`
+
+ Body param: The inference speed mode for this request. `"fast"` enables high output-tokens-per-second inference.
+
+- `--stop-sequence: optional array of string`
+
+ Body param: Custom text sequences that will cause the model to stop generating.
+
+ Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
+
+ If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.
+
+- `--system: optional string or array of BetaTextBlockParam`
+
+ Body param: System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--temperature: optional number`
+
+ Body param: Amount of randomness injected into the response.
+
+ Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
+
+ Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
+
+- `--thinking: optional BetaThinkingConfigEnabled or BetaThinkingConfigDisabled or BetaThinkingConfigAdaptive`
+
+ Body param: Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional BetaToolChoiceAuto or BetaToolChoiceAny or BetaToolChoiceTool or BetaToolChoiceNone`
+
+ Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of BetaToolUnion`
+
+ Body param: Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+- `--top-k: optional number`
+
+ Body param: Only sample from the top K options for each subsequent token.
+
+ Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--top-p: optional number`
+
+ Body param: Use nucleus sampling.
+
+ In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_message: object { id, container, content, 8 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at, skills }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `skills: array of BetaSkill`
+
+ Skills loaded in the container
+
+ - `skill_id: string`
+
+ Skill ID
+
+ - `type: "anthropic" or "custom"`
+
+ Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
+
+ - `"anthropic"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ Skill version or 'latest' for most recent version
+
+ - `content: array of BetaContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `beta_text_block: object { citations, text, type }`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `beta_thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `beta_redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `beta_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_server_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_search_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebSearchToolResultError or array of BetaWebSearchResultBlock`
+
+ - `beta_web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of BetaWebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_web_fetch_tool_result_block: object { content, tool_use_id, type, caller }`
+
+ - `content: BetaWebFetchToolResultErrorBlock or BetaWebFetchBlock`
+
+ - `beta_web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `beta_web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: BetaBase64PDFSource or BetaPlainTextSource`
+
+ - `beta_base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `beta_plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `beta_direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `beta_server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `beta_server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `beta_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaCodeExecutionToolResultError or BetaCodeExecutionResultBlock or BetaEncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `beta_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `beta_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `beta_encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of BetaCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `beta_bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaBashCodeExecutionToolResultError or BetaBashCodeExecutionResultBlock`
+
+ - `beta_bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `beta_bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BetaBashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `beta_text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaTextEditorCodeExecutionToolResultError or BetaTextEditorCodeExecutionViewResultBlock or BetaTextEditorCodeExecutionCreateResultBlock or BetaTextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `beta_text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `beta_text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `beta_text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `beta_text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `beta_tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BetaToolSearchToolResultError or BetaToolSearchToolSearchResultBlock`
+
+ - `beta_tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `beta_tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of BetaToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `beta_mcp_tool_use_block: object { id, input, name, 2 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ The name of the MCP tool
+
+ - `server_name: string`
+
+ The name of the MCP server
+
+ - `type: "mcp_tool_use"`
+
+ - `beta_mcp_tool_result_block: object { content, is_error, tool_use_id, type }`
+
+ - `content: string or array of BetaTextBlock`
+
+ - `union_member_0: string`
+
+ - `beta_mcp_tool_result_block_content: array of BetaTextBlock`
+
+ - `citations: array of BetaTextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `beta_citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `beta_citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `beta_citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `beta_citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `beta_citation_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `is_error: boolean`
+
+ - `tool_use_id: string`
+
+ - `type: "mcp_tool_result"`
+
+ - `beta_container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `beta_compaction_block: object { content, type }`
+
+ A compaction block returned when autocompact is triggered.
+
+ When content is None, it indicates the compaction failed to produce a valid
+ summary (e.g., malformed output from the model). Clients may round-trip
+ compaction blocks with null content; the server treats them as no-ops.
+
+ - `content: string`
+
+ Summary of compacted content, or null if compaction failed
+
+ - `type: "compaction"`
+
+ - `context_management: object { applied_edits }`
+
+ Context management response.
+
+ Information about context management strategies applied during the request.
+
+ - `applied_edits: array of BetaClearToolUses20250919EditResponse or BetaClearThinking20251015EditResponse`
+
+ List of context management edits that were applied.
+
+ - `beta_clear_tool_uses_20250919_edit_response: object { cleared_input_tokens, cleared_tool_uses, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_tool_uses: number`
+
+ Number of tool uses that were cleared.
+
+ - `type: "clear_tool_uses_20250919"`
+
+ The type of context management edit applied.
+
+ - `beta_clear_thinking_20251015_edit_response: object { cleared_input_tokens, cleared_thinking_turns, type }`
+
+ - `cleared_input_tokens: number`
+
+ Number of input tokens cleared by this edit.
+
+ - `cleared_thinking_turns: number`
+
+ Number of thinking turns that were cleared.
+
+ - `type: "clear_thinking_20251015"`
+
+ The type of context management edit applied.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 5 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"compaction"`
+
+ - `"refusal"`
+
+ - `"model_context_window_exceeded"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 7 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `iterations: array of BetaMessageIterationUsage or BetaCompactionIterationUsage`
+
+ Per-iteration token usage breakdown.
+
+ Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to:
+
+ - Determine which iterations exceeded long context thresholds (>=200k tokens)
+ - Calculate the true context window size from the last iteration
+ - Understand token accumulation across server-side tool use loops
+
+ - `beta_message_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a sampling iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "message"`
+
+ Usage for a sampling iteration
+
+ - `beta_compaction_iteration_usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }`
+
+ Token usage for a compaction iteration.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `type: "compaction"`
+
+ Usage for a compaction iteration
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `speed: "standard" or "fast"`
+
+ The inference speed mode used for this request.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Example
+
+```cli
+ant beta:messages create \
+ --api-key my-anthropic-api-key \
+ --max-tokens 1024 \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-opus-4-6
+```
diff --git a/content/en/api/cli/beta/models.md b/content/en/api/cli/beta/models.md
index b49b133e5..9a2649b75 100644
--- a/content/en/api/cli/beta/models.md
+++ b/content/en/api/cli/beta/models.md
@@ -1 +1,920 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Models
+
+## List
+
+`$ ant beta:models list`
+
+**get** `/v1/models`
+
+List available models.
+
+The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListResponse_ModelInfo_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of BetaModelInfo`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant beta:models list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:models retrieve`
+
+**get** `/v1/models/{model_id}`
+
+Get a specific model.
+
+The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
+
+### Parameters
+
+- `--model-id: string`
+
+ Model identifier or alias.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_model_info: object { id, capabilities, created_at, 4 more }`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+### Example
+
+```cli
+ant beta:models retrieve \
+ --api-key my-anthropic-api-key \
+ --model-id model_id
+```
+
+## Domain Types
+
+### Beta Capability Support
+
+- `beta_capability_support: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Context Management Capability
+
+- `beta_context_management_capability: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management capability details.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Effort Capability
+
+- `beta_effort_capability: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) capability details.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Model Capabilities
+
+- `beta_model_capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Model Info
+
+- `beta_model_info: object { id, capabilities, created_at, 4 more }`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+### Beta Thinking Capability
+
+- `beta_thinking_capability: object { supported, types }`
+
+ Thinking capability details.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Beta Thinking Types
+
+- `beta_thinking_types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
diff --git a/content/en/api/cli/beta/models/list.md b/content/en/api/cli/beta/models/list.md
index d4238aa95..dd6086bb1 100644
--- a/content/en/api/cli/beta/models/list.md
+++ b/content/en/api/cli/beta/models/list.md
@@ -1 +1,232 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## List
+
+`$ ant beta:models list`
+
+**get** `/v1/models`
+
+List available models.
+
+The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListResponse_ModelInfo_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of BetaModelInfo`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant beta:models list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/models/retrieve.md b/content/en/api/cli/beta/models/retrieve.md
index 73e3324ff..480fd3578 100644
--- a/content/en/api/cli/beta/models/retrieve.md
+++ b/content/en/api/cli/beta/models/retrieve.md
@@ -1 +1,209 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Retrieve
+
+`$ ant beta:models retrieve`
+
+**get** `/v1/models/{model_id}`
+
+Get a specific model.
+
+The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
+
+### Parameters
+
+- `--model-id: string`
+
+ Model identifier or alias.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_model_info: object { id, capabilities, created_at, 4 more }`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+### Example
+
+```cli
+ant beta:models retrieve \
+ --api-key my-anthropic-api-key \
+ --model-id model_id
+```
diff --git a/content/en/api/cli/beta/sessions.md b/content/en/api/cli/beta/sessions.md
new file mode 100644
index 000000000..c72f94a90
--- /dev/null
+++ b/content/en/api/cli/beta/sessions.md
@@ -0,0 +1,12932 @@
+# Sessions
+
+## Create
+
+`$ ant beta:sessions create`
+
+**post** `/v1/sessions`
+
+Create Session
+
+### Parameters
+
+- `--agent: string or BetaManagedAgentsAgentParams`
+
+ Body param: Agent identifier. Accepts the `agent` ID string, which pins the latest version for the session, or an `agent` object with both id and version specified.
+
+- `--environment-id: string`
+
+ Body param: ID of the `environment` defining the container configuration for this session.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata attached to the session.
+
+- `--resource: optional array of BetaManagedAgentsGitHubRepositoryResourceParams or BetaManagedAgentsFileResourceParams`
+
+ Body param: Resources (e.g. repositories, files) to mount into the session's container.
+
+- `--title: optional string`
+
+ Body param: Human-readable session title.
+
+- `--vault-id: optional array of string`
+
+ Body param: Vault IDs for stored credentials the agent can use during the session.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions create \
+ --api-key my-anthropic-api-key \
+ --agent agent_011CZkYpogX7uDKUyvBTophP \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
+
+## List
+
+`$ ant beta:sessions list`
+
+**get** `/v1/sessions`
+
+List Sessions
+
+### Parameters
+
+- `--agent-id: optional string`
+
+ Query param: Filter sessions created with this agent ID.
+
+- `--agent-version: optional number`
+
+ Query param: Filter by agent version. Only applies when agent_id is also set.
+
+- `--created-at-gt: optional string`
+
+ Query param: Return sessions created after this time (exclusive).
+
+- `--created-at-gte: optional string`
+
+ Query param: Return sessions created at or after this time (inclusive).
+
+- `--created-at-lt: optional string`
+
+ Query param: Return sessions created before this time (exclusive).
+
+- `--created-at-lte: optional string`
+
+ Query param: Return sessions created at or before this time (inclusive).
+
+- `--include-archived: optional boolean`
+
+ Query param: When true, includes archived sessions. Default: false (exclude archived).
+
+- `--limit: optional number`
+
+ Query param: Maximum number of results to return.
+
+- `--order: optional "asc" or "desc"`
+
+ Query param: Sort direction for results, ordered by created_at. Defaults to desc (newest first).
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response's next_page.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessions: object { data, next_page }`
+
+ Paginated list of sessions.
+
+ - `data: optional array of BetaManagedAgentsSession`
+
+ List of sessions.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:sessions retrieve`
+
+**get** `/v1/sessions/{session_id}`
+
+Get Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions retrieve \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Update
+
+`$ ant beta:sessions update`
+
+**post** `/v1/sessions/{session_id}`
+
+Update Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.
+
+- `--title: optional string`
+
+ Body param: Human-readable session title.
+
+- `--vault-id: optional array of string`
+
+ Body param: Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions update \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Delete
+
+`$ ant beta:sessions delete`
+
+**delete** `/v1/sessions/{session_id}`
+
+Delete Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_session: object { id, type }`
+
+ Confirmation that a `session` has been permanently deleted.
+
+ - `id: string`
+
+ - `type: "session_deleted"`
+
+ - `"session_deleted"`
+
+### Example
+
+```cli
+ant beta:sessions delete \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Archive
+
+`$ ant beta:sessions archive`
+
+**post** `/v1/sessions/{session_id}/archive`
+
+Archive Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions archive \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Domain Types
+
+### Beta Managed Agents Agent Params
+
+- `beta_managed_agents_agent_params: object { id, type, version }`
+
+ Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version
+
+ - `id: string`
+
+ The `agent` ID.
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: optional number`
+
+ The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.
+
+### Beta Managed Agents Branch Checkout
+
+- `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+### Beta Managed Agents Cache Creation Usage
+
+- `beta_managed_agents_cache_creation_usage: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+### Beta Managed Agents Commit Checkout
+
+- `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+### Beta Managed Agents Deleted Session
+
+- `beta_managed_agents_deleted_session: object { id, type }`
+
+ Confirmation that a `session` has been permanently deleted.
+
+ - `id: string`
+
+ - `type: "session_deleted"`
+
+ - `"session_deleted"`
+
+### Beta Managed Agents File Resource Params
+
+- `beta_managed_agents_file_resource_params: object { file_id, type, mount_path }`
+
+ Mount a file uploaded via the Files API into the session.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `mount_path: optional string`
+
+ Mount path in the container. Defaults to `/mnt/session/uploads/`.
+
+### Beta Managed Agents GitHub Repository Resource Params
+
+- `beta_managed_agents_github_repository_resource_params: object { authorization_token, type, url, 2 more }`
+
+ Mount a GitHub repository into the session's container.
+
+ - `authorization_token: string`
+
+ GitHub authorization token used to clone the repository.
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `url: string`
+
+ Github URL of the repository
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ Branch or commit to check out. Defaults to the repository's default branch.
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `mount_path: optional string`
+
+ Mount path in the container. Defaults to `/workspace/`.
+
+### Beta Managed Agents Session
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Beta Managed Agents Session Agent
+
+- `beta_managed_agents_session_agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+### Beta Managed Agents Session Stats
+
+- `beta_managed_agents_session_stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+### Beta Managed Agents Session Usage
+
+- `beta_managed_agents_session_usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+# Events
+
+## List
+
+`$ ant beta:sessions:events list`
+
+**get** `/v1/sessions/{session_id}/events`
+
+List Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--limit: optional number`
+
+ Query param: Query parameter for limit
+
+- `--order: optional "asc" or "desc"`
+
+ Query param: Sort direction for results, ordered by created_at. Defaults to asc (chronological).
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response's next_page.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessionEvents: object { data, next_page }`
+
+ Paginated list of events for a `session`.
+
+ - `data: optional array of BetaManagedAgentsSessionEvent`
+
+ Events for the session, ordered by `created_at`.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions:events list \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Send
+
+`$ ant beta:sessions:events send`
+
+**post** `/v1/sessions/{session_id}/events`
+
+Send Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--event: array of BetaManagedAgentsEventParams`
+
+ Body param: Events to send to the `session`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_send_session_events: object { data }`
+
+ Events that were successfully sent to the session.
+
+ - `data: optional array of BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or BetaManagedAgentsUserCustomToolResultEvent`
+
+ Sent events
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:events send \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --event "{content: [{text: 'Where is my order #1234?', type: text}], type: user.message}"
+```
+
+## Stream
+
+`$ ant beta:sessions:events stream`
+
+**get** `/v1/sessions/{session_id}/events/stream`
+
+Stream Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_stream_session_events: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Server-sent event in the session stream.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Example
+
+```cli
+ant beta:sessions:events stream \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Domain Types
+
+### Beta Managed Agents Agent Custom Tool Use Event
+
+- `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+### Beta Managed Agents Agent MCP Tool Result Event
+
+- `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents Agent MCP Tool Use Event
+
+- `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+### Beta Managed Agents Agent Message Event
+
+- `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+### Beta Managed Agents Agent Thinking Event
+
+- `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+### Beta Managed Agents Agent Thread Context Compacted Event
+
+- `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+### Beta Managed Agents Agent Tool Result Event
+
+- `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents Agent Tool Use Event
+
+- `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+### Beta Managed Agents Base64 Document Source
+
+- `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+### Beta Managed Agents Base64 Image Source
+
+- `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+### Beta Managed Agents Billing Error
+
+- `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+### Beta Managed Agents Document Block
+
+- `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+### Beta Managed Agents Event Params
+
+- `beta_managed_agents_event_params: BetaManagedAgentsUserMessageEventParams or BetaManagedAgentsUserInterruptEventParams or BetaManagedAgentsUserToolConfirmationEventParams or BetaManagedAgentsUserCustomToolResultEventParams`
+
+ Union type for event parameters that can be sent to a session.
+
+ - `beta_managed_agents_user_message_event_params: object { content, type }`
+
+ Parameters for sending a user message to the session.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks for the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `beta_managed_agents_user_interrupt_event_params: object { type }`
+
+ Parameters for sending an interrupt to pause the agent.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `beta_managed_agents_user_tool_confirmation_event_params: object { result, tool_use_id, type, deny_message }`
+
+ Parameters for confirming or denying a tool execution request.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `beta_managed_agents_user_custom_tool_result_event_params: object { custom_tool_use_id, type, content, is_error }`
+
+ Parameters for providing the result of a custom tool execution.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents File Document Source
+
+- `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+### Beta Managed Agents File Image Source
+
+- `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+### Beta Managed Agents Image Block
+
+- `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+### Beta Managed Agents MCP Authentication Failed Error
+
+- `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+### Beta Managed Agents MCP Connection Failed Error
+
+- `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+### Beta Managed Agents Model Overloaded Error
+
+- `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+### Beta Managed Agents Model Rate Limited Error
+
+- `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+### Beta Managed Agents Model Request Failed Error
+
+- `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+### Beta Managed Agents Plain Text Document Source
+
+- `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+### Beta Managed Agents Retry Status Exhausted
+
+- `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+### Beta Managed Agents Retry Status Retrying
+
+- `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+### Beta Managed Agents Retry Status Terminal
+
+- `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+### Beta Managed Agents Send Session Events
+
+- `beta_managed_agents_send_session_events: object { data }`
+
+ Events that were successfully sent to the session.
+
+ - `data: optional array of BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or BetaManagedAgentsUserCustomToolResultEvent`
+
+ Sent events
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents Session Deleted Event
+
+- `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Session End Turn
+
+- `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+### Beta Managed Agents Session Error Event
+
+- `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+### Beta Managed Agents Session Event
+
+- `beta_managed_agents_session_event: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Union type for all event types in a session.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Session Requires Action
+
+- `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+### Beta Managed Agents Session Retries Exhausted
+
+- `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+### Beta Managed Agents Session Status Idle Event
+
+- `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+### Beta Managed Agents Session Status Rescheduled Event
+
+- `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+### Beta Managed Agents Session Status Running Event
+
+- `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+### Beta Managed Agents Session Status Terminated Event
+
+- `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+### Beta Managed Agents Span Model Request End Event
+
+- `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+### Beta Managed Agents Span Model Request Start Event
+
+- `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+### Beta Managed Agents Span Model Usage
+
+- `beta_managed_agents_span_model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Managed Agents Stream Session Events
+
+- `beta_managed_agents_stream_session_events: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Server-sent event in the session stream.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Text Block
+
+- `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+### Beta Managed Agents Unknown Error
+
+- `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+### Beta Managed Agents URL Document Source
+
+- `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+### Beta Managed Agents URL Image Source
+
+- `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+### Beta Managed Agents User Custom Tool Result Event
+
+- `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Custom Tool Result Event Params
+
+- `beta_managed_agents_user_custom_tool_result_event_params: object { custom_tool_use_id, type, content, is_error }`
+
+ Parameters for providing the result of a custom tool execution.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents User Interrupt Event
+
+- `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Interrupt Event Params
+
+- `beta_managed_agents_user_interrupt_event_params: object { type }`
+
+ Parameters for sending an interrupt to pause the agent.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+### Beta Managed Agents User Message Event
+
+- `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Message Event Params
+
+- `beta_managed_agents_user_message_event_params: object { content, type }`
+
+ Parameters for sending a user message to the session.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks for the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+### Beta Managed Agents User Tool Confirmation Event
+
+- `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Tool Confirmation Event Params
+
+- `beta_managed_agents_user_tool_confirmation_event_params: object { result, tool_use_id, type, deny_message }`
+
+ Parameters for confirming or denying a tool execution request.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+# Resources
+
+## Add
+
+`$ ant beta:sessions:resources add`
+
+**post** `/v1/sessions/{session_id}/resources`
+
+Add Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--file-id: string`
+
+ Body param: ID of a previously uploaded file.
+
+- `--type: "file"`
+
+ Body param
+
+- `--mount-path: optional string`
+
+ Body param: Mount path in the container. Defaults to `/mnt/session/uploads/`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources add \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --file-id file_011CNha8iCJcU1wXNR6q4V8w \
+ --type file
+```
+
+## List
+
+`$ ant beta:sessions:resources list`
+
+**get** `/v1/sessions/{session_id}/resources`
+
+List Session Resources
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--limit: optional number`
+
+ Query param: Maximum number of resources to return per page (max 1000). If omitted, returns all resources.
+
+- `--page: optional string`
+
+ Query param: Opaque cursor from a previous response's next_page field.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessionResources: object { data, next_page }`
+
+ Paginated list of resources attached to a session.
+
+ - `data: array of BetaManagedAgentsSessionResource`
+
+ Resources for the session, ordered by `created_at`.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions:resources list \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Retrieve
+
+`$ ant beta:sessions:resources retrieve`
+
+**get** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Get Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSessionResourceGetResponse: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ The requested session resource.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources retrieve \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht
+```
+
+## Update
+
+`$ ant beta:sessions:resources update`
+
+**post** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Update Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--authorization-token: string`
+
+ Body param: New authorization token for the resource. Currently only `github_repository` resources support token rotation.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSessionResourceUpdateResponse: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ The updated session resource.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources update \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht \
+ --authorization-token ghp_exampletoken
+```
+
+## Delete
+
+`$ ant beta:sessions:resources delete`
+
+**delete** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Delete Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_delete_session_resource: object { id, type }`
+
+ Confirmation of resource deletion.
+
+ - `id: string`
+
+ - `type: "session_resource_deleted"`
+
+ - `"session_resource_deleted"`
+
+### Example
+
+```cli
+ant beta:sessions:resources delete \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht
+```
+
+## Domain Types
+
+### Beta Managed Agents Delete Session Resource
+
+- `beta_managed_agents_delete_session_resource: object { id, type }`
+
+ Confirmation of resource deletion.
+
+ - `id: string`
+
+ - `type: "session_resource_deleted"`
+
+ - `"session_resource_deleted"`
+
+### Beta Managed Agents File Resource
+
+- `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents GitHub Repository Resource
+
+- `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+### Beta Managed Agents Session Resource
+
+- `beta_managed_agents_session_resource: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
diff --git a/content/en/api/cli/beta/sessions/archive.md b/content/en/api/cli/beta/sessions/archive.md
new file mode 100644
index 000000000..32d02d78f
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/archive.md
@@ -0,0 +1,447 @@
+## Archive
+
+`$ ant beta:sessions archive`
+
+**post** `/v1/sessions/{session_id}/archive`
+
+Archive Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions archive \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
diff --git a/content/en/api/cli/beta/sessions/create.md b/content/en/api/cli/beta/sessions/create.md
new file mode 100644
index 000000000..be08c2d34
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/create.md
@@ -0,0 +1,468 @@
+## Create
+
+`$ ant beta:sessions create`
+
+**post** `/v1/sessions`
+
+Create Session
+
+### Parameters
+
+- `--agent: string or BetaManagedAgentsAgentParams`
+
+ Body param: Agent identifier. Accepts the `agent` ID string, which pins the latest version for the session, or an `agent` object with both id and version specified.
+
+- `--environment-id: string`
+
+ Body param: ID of the `environment` defining the container configuration for this session.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata attached to the session.
+
+- `--resource: optional array of BetaManagedAgentsGitHubRepositoryResourceParams or BetaManagedAgentsFileResourceParams`
+
+ Body param: Resources (e.g. repositories, files) to mount into the session's container.
+
+- `--title: optional string`
+
+ Body param: Human-readable session title.
+
+- `--vault-id: optional array of string`
+
+ Body param: Vault IDs for stored credentials the agent can use during the session.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions create \
+ --api-key my-anthropic-api-key \
+ --agent agent_011CZkYpogX7uDKUyvBTophP \
+ --environment-id env_011CZkZ9X2dpNyB7HsEFoRfW
+```
diff --git a/content/en/api/cli/beta/sessions/delete.md b/content/en/api/cli/beta/sessions/delete.md
new file mode 100644
index 000000000..b08d5960d
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/delete.md
@@ -0,0 +1,37 @@
+## Delete
+
+`$ ant beta:sessions delete`
+
+**delete** `/v1/sessions/{session_id}`
+
+Delete Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_session: object { id, type }`
+
+ Confirmation that a `session` has been permanently deleted.
+
+ - `id: string`
+
+ - `type: "session_deleted"`
+
+ - `"session_deleted"`
+
+### Example
+
+```cli
+ant beta:sessions delete \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
diff --git a/content/en/api/cli/beta/sessions/events.md b/content/en/api/cli/beta/sessions/events.md
new file mode 100644
index 000000000..6de98f456
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/events.md
@@ -0,0 +1,9136 @@
+# Events
+
+## List
+
+`$ ant beta:sessions:events list`
+
+**get** `/v1/sessions/{session_id}/events`
+
+List Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--limit: optional number`
+
+ Query param: Query parameter for limit
+
+- `--order: optional "asc" or "desc"`
+
+ Query param: Sort direction for results, ordered by created_at. Defaults to asc (chronological).
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response's next_page.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessionEvents: object { data, next_page }`
+
+ Paginated list of events for a `session`.
+
+ - `data: optional array of BetaManagedAgentsSessionEvent`
+
+ Events for the session, ordered by `created_at`.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions:events list \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Send
+
+`$ ant beta:sessions:events send`
+
+**post** `/v1/sessions/{session_id}/events`
+
+Send Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--event: array of BetaManagedAgentsEventParams`
+
+ Body param: Events to send to the `session`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_send_session_events: object { data }`
+
+ Events that were successfully sent to the session.
+
+ - `data: optional array of BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or BetaManagedAgentsUserCustomToolResultEvent`
+
+ Sent events
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:events send \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --event "{content: [{text: 'Where is my order #1234?', type: text}], type: user.message}"
+```
+
+## Stream
+
+`$ ant beta:sessions:events stream`
+
+**get** `/v1/sessions/{session_id}/events/stream`
+
+Stream Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_stream_session_events: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Server-sent event in the session stream.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Example
+
+```cli
+ant beta:sessions:events stream \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Domain Types
+
+### Beta Managed Agents Agent Custom Tool Use Event
+
+- `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+### Beta Managed Agents Agent MCP Tool Result Event
+
+- `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents Agent MCP Tool Use Event
+
+- `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+### Beta Managed Agents Agent Message Event
+
+- `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+### Beta Managed Agents Agent Thinking Event
+
+- `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+### Beta Managed Agents Agent Thread Context Compacted Event
+
+- `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+### Beta Managed Agents Agent Tool Result Event
+
+- `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents Agent Tool Use Event
+
+- `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+### Beta Managed Agents Base64 Document Source
+
+- `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+### Beta Managed Agents Base64 Image Source
+
+- `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+### Beta Managed Agents Billing Error
+
+- `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+### Beta Managed Agents Document Block
+
+- `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+### Beta Managed Agents Event Params
+
+- `beta_managed_agents_event_params: BetaManagedAgentsUserMessageEventParams or BetaManagedAgentsUserInterruptEventParams or BetaManagedAgentsUserToolConfirmationEventParams or BetaManagedAgentsUserCustomToolResultEventParams`
+
+ Union type for event parameters that can be sent to a session.
+
+ - `beta_managed_agents_user_message_event_params: object { content, type }`
+
+ Parameters for sending a user message to the session.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks for the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `beta_managed_agents_user_interrupt_event_params: object { type }`
+
+ Parameters for sending an interrupt to pause the agent.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `beta_managed_agents_user_tool_confirmation_event_params: object { result, tool_use_id, type, deny_message }`
+
+ Parameters for confirming or denying a tool execution request.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `beta_managed_agents_user_custom_tool_result_event_params: object { custom_tool_use_id, type, content, is_error }`
+
+ Parameters for providing the result of a custom tool execution.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents File Document Source
+
+- `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+### Beta Managed Agents File Image Source
+
+- `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+### Beta Managed Agents Image Block
+
+- `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+### Beta Managed Agents MCP Authentication Failed Error
+
+- `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+### Beta Managed Agents MCP Connection Failed Error
+
+- `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+### Beta Managed Agents Model Overloaded Error
+
+- `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+### Beta Managed Agents Model Rate Limited Error
+
+- `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+### Beta Managed Agents Model Request Failed Error
+
+- `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+### Beta Managed Agents Plain Text Document Source
+
+- `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+### Beta Managed Agents Retry Status Exhausted
+
+- `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+### Beta Managed Agents Retry Status Retrying
+
+- `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+### Beta Managed Agents Retry Status Terminal
+
+- `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+### Beta Managed Agents Send Session Events
+
+- `beta_managed_agents_send_session_events: object { data }`
+
+ Events that were successfully sent to the session.
+
+ - `data: optional array of BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or BetaManagedAgentsUserCustomToolResultEvent`
+
+ Sent events
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents Session Deleted Event
+
+- `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Session End Turn
+
+- `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+### Beta Managed Agents Session Error Event
+
+- `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+### Beta Managed Agents Session Event
+
+- `beta_managed_agents_session_event: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Union type for all event types in a session.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Session Requires Action
+
+- `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+### Beta Managed Agents Session Retries Exhausted
+
+- `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+### Beta Managed Agents Session Status Idle Event
+
+- `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+### Beta Managed Agents Session Status Rescheduled Event
+
+- `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+### Beta Managed Agents Session Status Running Event
+
+- `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+### Beta Managed Agents Session Status Terminated Event
+
+- `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+### Beta Managed Agents Span Model Request End Event
+
+- `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+### Beta Managed Agents Span Model Request Start Event
+
+- `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+### Beta Managed Agents Span Model Usage
+
+- `beta_managed_agents_span_model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+### Beta Managed Agents Stream Session Events
+
+- `beta_managed_agents_stream_session_events: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Server-sent event in the session stream.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Beta Managed Agents Text Block
+
+- `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+### Beta Managed Agents Unknown Error
+
+- `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+### Beta Managed Agents URL Document Source
+
+- `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+### Beta Managed Agents URL Image Source
+
+- `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+### Beta Managed Agents User Custom Tool Result Event
+
+- `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Custom Tool Result Event Params
+
+- `beta_managed_agents_user_custom_tool_result_event_params: object { custom_tool_use_id, type, content, is_error }`
+
+ Parameters for providing the result of a custom tool execution.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+### Beta Managed Agents User Interrupt Event
+
+- `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Interrupt Event Params
+
+- `beta_managed_agents_user_interrupt_event_params: object { type }`
+
+ Parameters for sending an interrupt to pause the agent.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+### Beta Managed Agents User Message Event
+
+- `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Message Event Params
+
+- `beta_managed_agents_user_message_event_params: object { content, type }`
+
+ Parameters for sending a user message to the session.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks for the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+### Beta Managed Agents User Tool Confirmation Event
+
+- `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents User Tool Confirmation Event Params
+
+- `beta_managed_agents_user_tool_confirmation_event_params: object { result, tool_use_id, type, deny_message }`
+
+ Parameters for confirming or denying a tool execution request.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
diff --git a/content/en/api/cli/beta/sessions/events/list.md b/content/en/api/cli/beta/sessions/events/list.md
new file mode 100644
index 000000000..707e40ae1
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/events/list.md
@@ -0,0 +1,1415 @@
+## List
+
+`$ ant beta:sessions:events list`
+
+**get** `/v1/sessions/{session_id}/events`
+
+List Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--limit: optional number`
+
+ Query param: Query parameter for limit
+
+- `--order: optional "asc" or "desc"`
+
+ Query param: Sort direction for results, ordered by created_at. Defaults to asc (chronological).
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response's next_page.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessionEvents: object { data, next_page }`
+
+ Paginated list of events for a `session`.
+
+ - `data: optional array of BetaManagedAgentsSessionEvent`
+
+ Events for the session, ordered by `created_at`.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions:events list \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
diff --git a/content/en/api/cli/beta/sessions/events/send.md b/content/en/api/cli/beta/sessions/events/send.md
new file mode 100644
index 000000000..0d29b585e
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/events/send.md
@@ -0,0 +1,420 @@
+## Send
+
+`$ ant beta:sessions:events send`
+
+**post** `/v1/sessions/{session_id}/events`
+
+Send Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--event: array of BetaManagedAgentsEventParams`
+
+ Body param: Events to send to the `session`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_send_session_events: object { data }`
+
+ Events that were successfully sent to the session.
+
+ - `data: optional array of BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or BetaManagedAgentsUserCustomToolResultEvent`
+
+ Sent events
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:events send \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --event "{content: [{text: 'Where is my order #1234?', type: text}], type: user.message}"
+```
diff --git a/content/en/api/cli/beta/sessions/events/stream.md b/content/en/api/cli/beta/sessions/events/stream.md
new file mode 100644
index 000000000..69f1ab35a
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/events/stream.md
@@ -0,0 +1,1395 @@
+## Stream
+
+`$ ant beta:sessions:events stream`
+
+**get** `/v1/sessions/{session_id}/events/stream`
+
+Stream Events
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_stream_session_events: BetaManagedAgentsUserMessageEvent or BetaManagedAgentsUserInterruptEvent or BetaManagedAgentsUserToolConfirmationEvent or 17 more`
+
+ Server-sent event in the session stream.
+
+ - `beta_managed_agents_user_message_event: object { id, content, type, processed_at }`
+
+ A user message event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ Array of content blocks comprising the user message.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `type: "user.message"`
+
+ - `"user.message"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_interrupt_event: object { id, type, processed_at }`
+
+ An interrupt event that pauses agent execution and returns control to the user.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `type: "user.interrupt"`
+
+ - `"user.interrupt"`
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_tool_confirmation_event: object { id, result, tool_use_id, 3 more }`
+
+ A tool confirmation event that approves or denies a pending tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `result: "allow" or "deny"`
+
+ UserToolConfirmationResult enum
+
+ - `"allow"`
+
+ - `"deny"`
+
+ - `tool_use_id: string`
+
+ 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.
+
+ - `type: "user.tool_confirmation"`
+
+ - `"user.tool_confirmation"`
+
+ - `deny_message: optional string`
+
+ Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_user_custom_tool_result_event: object { id, custom_tool_use_id, type, 3 more }`
+
+ Event sent by the client providing the result of a custom tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `custom_tool_use_id: string`
+
+ 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.
+
+ - `type: "user.custom_tool_result"`
+
+ - `"user.custom_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `processed_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `beta_managed_agents_agent_custom_tool_use_event: object { id, input, name, 2 more }`
+
+ Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the custom tool being called.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.custom_tool_use"`
+
+ - `"agent.custom_tool_use"`
+
+ - `beta_managed_agents_agent_message_event: object { id, content, processed_at, type }`
+
+ An agent response event in the session conversation.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `content: array of BetaManagedAgentsTextBlock`
+
+ Array of text blocks comprising the agent response.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.message"`
+
+ - `"agent.message"`
+
+ - `beta_managed_agents_agent_thinking_event: object { id, processed_at, type }`
+
+ Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thinking"`
+
+ - `"agent.thinking"`
+
+ - `beta_managed_agents_agent_mcp_tool_use_event: object { id, input, mcp_server_name, 4 more }`
+
+ Event emitted when the agent invokes a tool provided by an MCP server.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server providing the tool.
+
+ - `name: string`
+
+ Name of the MCP tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_use"`
+
+ - `"agent.mcp_tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_mcp_tool_result_event: object { id, mcp_tool_use_id, processed_at, 3 more }`
+
+ Event representing the result of an MCP tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `mcp_tool_use_id: string`
+
+ The id of the `agent.mcp_tool_use` event this result corresponds to.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.mcp_tool_result"`
+
+ - `"agent.mcp_tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_tool_use_event: object { id, input, name, 3 more }`
+
+ Event emitted when the agent invokes a built-in agent tool.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `input: map[unknown]`
+
+ Input parameters for the tool call.
+
+ - `name: string`
+
+ Name of the agent tool being used.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.tool_use"`
+
+ - `"agent.tool_use"`
+
+ - `evaluated_permission: optional "allow" or "ask" or "deny"`
+
+ AgentEvaluatedPermission enum
+
+ - `"allow"`
+
+ - `"ask"`
+
+ - `"deny"`
+
+ - `beta_managed_agents_agent_tool_result_event: object { id, processed_at, tool_use_id, 3 more }`
+
+ Event representing the result of an agent tool execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `tool_use_id: string`
+
+ The id of the `agent.tool_use` event this result corresponds to.
+
+ - `type: "agent.tool_result"`
+
+ - `"agent.tool_result"`
+
+ - `content: optional array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock`
+
+ The result content returned by the tool.
+
+ - `beta_managed_agents_text_block: object { text, type }`
+
+ Regular text content.
+
+ - `text: string`
+
+ The text content.
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_image_block: object { source, type }`
+
+ Image content specified directly as base64 data or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
+
+ Union type for image source variants.
+
+ - `beta_managed_agents_base64_image_source: object { data, media_type, type }`
+
+ Base64-encoded image data.
+
+ - `data: string`
+
+ Base64-encoded image data.
+
+ - `media_type: string`
+
+ MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_url_image_source: object { type, url }`
+
+ Image referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the image to fetch.
+
+ - `beta_managed_agents_file_image_source: object { file_id, type }`
+
+ Image referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "image"`
+
+ - `"image"`
+
+ - `beta_managed_agents_document_block: object { source, type, context, title }`
+
+ Document content, either specified directly as base64 data, as text, or as a reference via a URL.
+
+ - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
+
+ Union type for document source variants.
+
+ - `beta_managed_agents_base64_document_source: object { data, media_type, type }`
+
+ Base64-encoded document data.
+
+ - `data: string`
+
+ Base64-encoded document data.
+
+ - `media_type: string`
+
+ MIME type of the document (e.g., "application/pdf").
+
+ - `type: "base64"`
+
+ - `"base64"`
+
+ - `beta_managed_agents_plain_text_document_source: object { data, media_type, type }`
+
+ Plain text document content.
+
+ - `data: string`
+
+ The plain text content.
+
+ - `media_type: "text/plain"`
+
+ MIME type of the text content. Must be "text/plain".
+
+ - `"text/plain"`
+
+ - `type: "text"`
+
+ - `"text"`
+
+ - `beta_managed_agents_url_document_source: object { type, url }`
+
+ Document referenced by URL.
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ URL of the document to fetch.
+
+ - `beta_managed_agents_file_document_source: object { file_id, type }`
+
+ Document referenced by file ID.
+
+ - `file_id: string`
+
+ ID of a previously uploaded file.
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `type: "document"`
+
+ - `"document"`
+
+ - `context: optional string`
+
+ Additional context about the document for the model.
+
+ - `title: optional string`
+
+ The title of the document.
+
+ - `is_error: optional boolean`
+
+ Whether the tool execution resulted in an error.
+
+ - `beta_managed_agents_agent_thread_context_compacted_event: object { id, processed_at, type }`
+
+ Indicates that context compaction (summarization) occurred during the session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "agent.thread_context_compacted"`
+
+ - `"agent.thread_context_compacted"`
+
+ - `beta_managed_agents_session_error_event: object { id, error, processed_at, type }`
+
+ An error event indicating a problem occurred during session execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `error: BetaManagedAgentsUnknownError or BetaManagedAgentsModelOverloadedError or BetaManagedAgentsModelRateLimitedError or 4 more`
+
+ 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.
+
+ - `beta_managed_agents_unknown_error: object { message, retry_status, type }`
+
+ An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "unknown_error"`
+
+ - `"unknown_error"`
+
+ - `beta_managed_agents_model_overloaded_error: object { message, retry_status, type }`
+
+ The model is currently overloaded. Emitted after automatic retries are exhausted.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_overloaded_error"`
+
+ - `"model_overloaded_error"`
+
+ - `beta_managed_agents_model_rate_limited_error: object { message, retry_status, type }`
+
+ The model request was rate-limited.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_rate_limited_error"`
+
+ - `"model_rate_limited_error"`
+
+ - `beta_managed_agents_model_request_failed_error: object { message, retry_status, type }`
+
+ A model request failed for a reason other than overload or rate-limiting.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "model_request_failed_error"`
+
+ - `"model_request_failed_error"`
+
+ - `beta_managed_agents_mcp_connection_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Failed to connect to an MCP server.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed to connect.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_connection_failed_error"`
+
+ - `"mcp_connection_failed_error"`
+
+ - `beta_managed_agents_mcp_authentication_failed_error: object { mcp_server_name, message, retry_status, type }`
+
+ Authentication to an MCP server failed.
+
+ - `mcp_server_name: string`
+
+ Name of the MCP server that failed authentication.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "mcp_authentication_failed_error"`
+
+ - `"mcp_authentication_failed_error"`
+
+ - `beta_managed_agents_billing_error: object { message, retry_status, type }`
+
+ The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
+
+ - `message: string`
+
+ Human-readable error description.
+
+ - `retry_status: BetaManagedAgentsRetryStatusRetrying or BetaManagedAgentsRetryStatusExhausted or BetaManagedAgentsRetryStatusTerminal`
+
+ What the client should do next in response to this error.
+
+ - `beta_managed_agents_retry_status_retrying: object { type }`
+
+ The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
+
+ - `type: "retrying"`
+
+ - `"retrying"`
+
+ - `beta_managed_agents_retry_status_exhausted: object { type }`
+
+ This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
+
+ - `type: "exhausted"`
+
+ - `"exhausted"`
+
+ - `beta_managed_agents_retry_status_terminal: object { type }`
+
+ The session encountered a terminal error and will transition to `terminated` state.
+
+ - `type: "terminal"`
+
+ - `"terminal"`
+
+ - `type: "billing_error"`
+
+ - `"billing_error"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.error"`
+
+ - `"session.error"`
+
+ - `beta_managed_agents_session_status_rescheduled_event: object { id, processed_at, type }`
+
+ Indicates the session is recovering from an error state and is rescheduled for execution.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_rescheduled"`
+
+ - `"session.status_rescheduled"`
+
+ - `beta_managed_agents_session_status_running_event: object { id, processed_at, type }`
+
+ Indicates the session is actively running and the agent is working.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_running"`
+
+ - `"session.status_running"`
+
+ - `beta_managed_agents_session_status_idle_event: object { id, processed_at, stop_reason, type }`
+
+ Indicates the agent has paused and is awaiting user input.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `beta_managed_agents_session_end_turn: object { type }`
+
+ The agent completed its turn naturally and is ready for the next user message.
+
+ - `type: "end_turn"`
+
+ - `"end_turn"`
+
+ - `beta_managed_agents_session_requires_action: object { event_ids, type }`
+
+ The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
+
+ - `event_ids: array of string`
+
+ The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.
+
+ - `type: "requires_action"`
+
+ - `"requires_action"`
+
+ - `beta_managed_agents_session_retries_exhausted: object { type }`
+
+ The turn ended because the retry budget was exhausted (`max_iterations` hit or an error escalated to `retry_status: 'exhausted'`).
+
+ - `type: "retries_exhausted"`
+
+ - `"retries_exhausted"`
+
+ - `type: "session.status_idle"`
+
+ - `"session.status_idle"`
+
+ - `beta_managed_agents_session_status_terminated_event: object { id, processed_at, type }`
+
+ Indicates the session has terminated, either due to an error or completion.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.status_terminated"`
+
+ - `"session.status_terminated"`
+
+ - `beta_managed_agents_span_model_request_start_event: object { id, processed_at, type }`
+
+ Emitted when a model request is initiated by the agent.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_start"`
+
+ - `"span.model_request_start"`
+
+ - `beta_managed_agents_span_model_request_end_event: object { id, is_error, model_request_start_id, 3 more }`
+
+ Emitted when a model request completes.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `is_error: boolean`
+
+ Whether the model request resulted in an error.
+
+ - `model_request_start_id: string`
+
+ The id of the corresponding `span.model_request_start` event.
+
+ - `model_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Token usage for a single model request.
+
+ - `cache_creation_input_tokens: number`
+
+ Tokens used to create prompt cache in this request.
+
+ - `cache_read_input_tokens: number`
+
+ Tokens read from prompt cache in this request.
+
+ - `input_tokens: number`
+
+ Input tokens consumed by this request.
+
+ - `output_tokens: number`
+
+ Output tokens generated by this request.
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "span.model_request_end"`
+
+ - `"span.model_request_end"`
+
+ - `beta_managed_agents_session_deleted_event: object { id, processed_at, type }`
+
+ Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.
+
+ - `id: string`
+
+ Unique identifier for this event.
+
+ - `processed_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `type: "session.deleted"`
+
+ - `"session.deleted"`
+
+### Example
+
+```cli
+ant beta:sessions:events stream \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
diff --git a/content/en/api/cli/beta/sessions/list.md b/content/en/api/cli/beta/sessions/list.md
new file mode 100644
index 000000000..af60cb225
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/list.md
@@ -0,0 +1,490 @@
+## List
+
+`$ ant beta:sessions list`
+
+**get** `/v1/sessions`
+
+List Sessions
+
+### Parameters
+
+- `--agent-id: optional string`
+
+ Query param: Filter sessions created with this agent ID.
+
+- `--agent-version: optional number`
+
+ Query param: Filter by agent version. Only applies when agent_id is also set.
+
+- `--created-at-gt: optional string`
+
+ Query param: Return sessions created after this time (exclusive).
+
+- `--created-at-gte: optional string`
+
+ Query param: Return sessions created at or after this time (inclusive).
+
+- `--created-at-lt: optional string`
+
+ Query param: Return sessions created before this time (exclusive).
+
+- `--created-at-lte: optional string`
+
+ Query param: Return sessions created at or before this time (inclusive).
+
+- `--include-archived: optional boolean`
+
+ Query param: When true, includes archived sessions. Default: false (exclude archived).
+
+- `--limit: optional number`
+
+ Query param: Maximum number of results to return.
+
+- `--order: optional "asc" or "desc"`
+
+ Query param: Sort direction for results, ordered by created_at. Defaults to desc (newest first).
+
+- `--page: optional string`
+
+ Query param: Opaque pagination cursor from a previous response's next_page.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessions: object { data, next_page }`
+
+ Paginated list of sessions.
+
+ - `data: optional array of BetaManagedAgentsSession`
+
+ List of sessions.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/sessions/resources.md b/content/en/api/cli/beta/sessions/resources.md
new file mode 100644
index 000000000..327a55b92
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/resources.md
@@ -0,0 +1,565 @@
+# Resources
+
+## Add
+
+`$ ant beta:sessions:resources add`
+
+**post** `/v1/sessions/{session_id}/resources`
+
+Add Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--file-id: string`
+
+ Body param: ID of a previously uploaded file.
+
+- `--type: "file"`
+
+ Body param
+
+- `--mount-path: optional string`
+
+ Body param: Mount path in the container. Defaults to `/mnt/session/uploads/`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources add \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --file-id file_011CNha8iCJcU1wXNR6q4V8w \
+ --type file
+```
+
+## List
+
+`$ ant beta:sessions:resources list`
+
+**get** `/v1/sessions/{session_id}/resources`
+
+List Session Resources
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--limit: optional number`
+
+ Query param: Maximum number of resources to return per page (max 1000). If omitted, returns all resources.
+
+- `--page: optional string`
+
+ Query param: Opaque cursor from a previous response's next_page field.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessionResources: object { data, next_page }`
+
+ Paginated list of resources attached to a session.
+
+ - `data: array of BetaManagedAgentsSessionResource`
+
+ Resources for the session, ordered by `created_at`.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions:resources list \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
+
+## Retrieve
+
+`$ ant beta:sessions:resources retrieve`
+
+**get** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Get Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSessionResourceGetResponse: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ The requested session resource.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources retrieve \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht
+```
+
+## Update
+
+`$ ant beta:sessions:resources update`
+
+**post** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Update Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--authorization-token: string`
+
+ Body param: New authorization token for the resource. Currently only `github_repository` resources support token rotation.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSessionResourceUpdateResponse: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ The updated session resource.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources update \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht \
+ --authorization-token ghp_exampletoken
+```
+
+## Delete
+
+`$ ant beta:sessions:resources delete`
+
+**delete** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Delete Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_delete_session_resource: object { id, type }`
+
+ Confirmation of resource deletion.
+
+ - `id: string`
+
+ - `type: "session_resource_deleted"`
+
+ - `"session_resource_deleted"`
+
+### Example
+
+```cli
+ant beta:sessions:resources delete \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht
+```
+
+## Domain Types
+
+### Beta Managed Agents Delete Session Resource
+
+- `beta_managed_agents_delete_session_resource: object { id, type }`
+
+ Confirmation of resource deletion.
+
+ - `id: string`
+
+ - `type: "session_resource_deleted"`
+
+ - `"session_resource_deleted"`
+
+### Beta Managed Agents File Resource
+
+- `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Beta Managed Agents GitHub Repository Resource
+
+- `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+### Beta Managed Agents Session Resource
+
+- `beta_managed_agents_session_resource: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
diff --git a/content/en/api/cli/beta/sessions/resources/add.md b/content/en/api/cli/beta/sessions/resources/add.md
new file mode 100644
index 000000000..b336a49cc
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/resources/add.md
@@ -0,0 +1,61 @@
+## Add
+
+`$ ant beta:sessions:resources add`
+
+**post** `/v1/sessions/{session_id}/resources`
+
+Add Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--file-id: string`
+
+ Body param: ID of a previously uploaded file.
+
+- `--type: "file"`
+
+ Body param
+
+- `--mount-path: optional string`
+
+ Body param: Mount path in the container. Defaults to `/mnt/session/uploads/`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources add \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --file-id file_011CNha8iCJcU1wXNR6q4V8w \
+ --type file
+```
diff --git a/content/en/api/cli/beta/sessions/resources/delete.md b/content/en/api/cli/beta/sessions/resources/delete.md
new file mode 100644
index 000000000..573243bef
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/resources/delete.md
@@ -0,0 +1,42 @@
+## Delete
+
+`$ ant beta:sessions:resources delete`
+
+**delete** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Delete Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_delete_session_resource: object { id, type }`
+
+ Confirmation of resource deletion.
+
+ - `id: string`
+
+ - `type: "session_resource_deleted"`
+
+ - `"session_resource_deleted"`
+
+### Example
+
+```cli
+ant beta:sessions:resources delete \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht
+```
diff --git a/content/en/api/cli/beta/sessions/resources/list.md b/content/en/api/cli/beta/sessions/resources/list.md
new file mode 100644
index 000000000..5fa79caf2
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/resources/list.md
@@ -0,0 +1,109 @@
+## List
+
+`$ ant beta:sessions:resources list`
+
+**get** `/v1/sessions/{session_id}/resources`
+
+List Session Resources
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--limit: optional number`
+
+ Query param: Maximum number of resources to return per page (max 1000). If omitted, returns all resources.
+
+- `--page: optional string`
+
+ Query param: Opaque cursor from a previous response's next_page field.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListSessionResources: object { data, next_page }`
+
+ Paginated list of resources attached to a session.
+
+ - `data: array of BetaManagedAgentsSessionResource`
+
+ Resources for the session, ordered by `created_at`.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `next_page: optional string`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```cli
+ant beta:sessions:resources list \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
diff --git a/content/en/api/cli/beta/sessions/resources/retrieve.md b/content/en/api/cli/beta/sessions/resources/retrieve.md
new file mode 100644
index 000000000..f92a7736b
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/resources/retrieve.md
@@ -0,0 +1,98 @@
+## Retrieve
+
+`$ ant beta:sessions:resources retrieve`
+
+**get** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Get Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSessionResourceGetResponse: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ The requested session resource.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources retrieve \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht
+```
diff --git a/content/en/api/cli/beta/sessions/resources/update.md b/content/en/api/cli/beta/sessions/resources/update.md
new file mode 100644
index 000000000..cc0d4f6bb
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/resources/update.md
@@ -0,0 +1,103 @@
+## Update
+
+`$ ant beta:sessions:resources update`
+
+**post** `/v1/sessions/{session_id}/resources/{resource_id}`
+
+Update Session Resource
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--resource-id: string`
+
+ Path param: Path parameter resource_id
+
+- `--authorization-token: string`
+
+ Body param: New authorization token for the resource. Currently only `github_repository` resources support token rotation.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSessionResourceUpdateResponse: BetaManagedAgentsGitHubRepositoryResource or BetaManagedAgentsFileResource`
+
+ The updated session resource.
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:sessions:resources update \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7 \
+ --resource-id sesrsc_011CZkZBJq5dWxk9fVLNcPht \
+ --authorization-token ghp_exampletoken
+```
diff --git a/content/en/api/cli/beta/sessions/retrieve.md b/content/en/api/cli/beta/sessions/retrieve.md
new file mode 100644
index 000000000..ebe655d94
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/retrieve.md
@@ -0,0 +1,447 @@
+## Retrieve
+
+`$ ant beta:sessions retrieve`
+
+**get** `/v1/sessions/{session_id}`
+
+Get Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path parameter session_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions retrieve \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
diff --git a/content/en/api/cli/beta/sessions/update.md b/content/en/api/cli/beta/sessions/update.md
new file mode 100644
index 000000000..f4f35e99a
--- /dev/null
+++ b/content/en/api/cli/beta/sessions/update.md
@@ -0,0 +1,459 @@
+## Update
+
+`$ ant beta:sessions update`
+
+**post** `/v1/sessions/{session_id}`
+
+Update Session
+
+### Parameters
+
+- `--session-id: string`
+
+ Path param: Path parameter session_id
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.
+
+- `--title: optional string`
+
+ Body param: Human-readable session title.
+
+- `--vault-id: optional array of string`
+
+ Body param: Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_session: object { id, agent, archived_at, 11 more }`
+
+ A Managed Agents `session`.
+
+ - `id: string`
+
+ - `agent: object { id, description, mcp_servers, 7 more }`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `id: string`
+
+ - `description: string`
+
+ - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
+
+ - `name: string`
+
+ - `type: "url"`
+
+ - `"url"`
+
+ - `url: string`
+
+ - `model: object { id, speed }`
+
+ Model identifier and configuration.
+
+ - `id: "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 5 more or string`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `speed: optional "standard" or "fast"`
+
+ 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.
+
+ - `"standard"`
+
+ - `"fast"`
+
+ - `name: string`
+
+ - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
+
+ - `beta_managed_agents_anthropic_skill: object { skill_id, type, version }`
+
+ A resolved Anthropic-managed skill.
+
+ - `skill_id: string`
+
+ - `type: "anthropic"`
+
+ - `"anthropic"`
+
+ - `version: string`
+
+ - `beta_managed_agents_custom_skill: object { skill_id, type, version }`
+
+ A resolved user-created custom skill.
+
+ - `skill_id: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `version: string`
+
+ - `system: string`
+
+ - `tools: array of BetaManagedAgentsAgentToolset20260401 or BetaManagedAgentsMCPToolset or BetaManagedAgentsCustomTool`
+
+ - `beta_managed_agents_agent_toolset20260401: object { configs, default_config, type }`
+
+ - `configs: array of BetaManagedAgentsAgentToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: "bash" or "edit" or "read" or 5 more`
+
+ Built-in agent tool identifier.
+
+ - `"bash"`
+
+ - `"edit"`
+
+ - `"read"`
+
+ - `"write"`
+
+ - `"glob"`
+
+ - `"grep"`
+
+ - `"web_fetch"`
+
+ - `"web_search"`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for agent tools.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `type: "agent_toolset_20260401"`
+
+ - `"agent_toolset_20260401"`
+
+ - `beta_managed_agents_mcp_toolset: object { configs, default_config, mcp_server_name, type }`
+
+ - `configs: array of BetaManagedAgentsMCPToolConfig`
+
+ - `enabled: boolean`
+
+ - `name: string`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `default_config: object { enabled, permission_policy }`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `enabled: boolean`
+
+ - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy`
+
+ Permission policy for tool execution.
+
+ - `beta_managed_agents_always_allow_policy: object { type }`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `type: "always_allow"`
+
+ - `"always_allow"`
+
+ - `beta_managed_agents_always_ask_policy: object { type }`
+
+ Tool calls require user confirmation before execution.
+
+ - `type: "always_ask"`
+
+ - `"always_ask"`
+
+ - `mcp_server_name: string`
+
+ - `type: "mcp_toolset"`
+
+ - `"mcp_toolset"`
+
+ - `beta_managed_agents_custom_tool: object { description, input_schema, name, type }`
+
+ A custom tool as returned in API responses.
+
+ - `description: string`
+
+ - `input_schema: object { properties, required, type }`
+
+ JSON Schema for custom tool input parameters.
+
+ - `properties: optional map[unknown]`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `required: optional array of string`
+
+ List of required property names.
+
+ - `type: optional "object"`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"`
+
+ - `name: string`
+
+ - `type: "custom"`
+
+ - `"custom"`
+
+ - `type: "agent"`
+
+ - `"agent"`
+
+ - `version: number`
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `environment_id: string`
+
+ - `metadata: map[string]`
+
+ - `resources: array of BetaManagedAgentsSessionResource`
+
+ - `beta_managed_agents_github_repository_resource: object { id, created_at, mount_path, 4 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `mount_path: string`
+
+ - `type: "github_repository"`
+
+ - `"github_repository"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `url: string`
+
+ - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout`
+
+ - `beta_managed_agents_branch_checkout: object { name, type }`
+
+ - `name: string`
+
+ Branch name to check out.
+
+ - `type: "branch"`
+
+ - `"branch"`
+
+ - `beta_managed_agents_commit_checkout: object { sha, type }`
+
+ - `sha: string`
+
+ Full commit SHA to check out.
+
+ - `type: "commit"`
+
+ - `"commit"`
+
+ - `beta_managed_agents_file_resource: object { id, created_at, file_id, 3 more }`
+
+ - `id: string`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `file_id: string`
+
+ - `mount_path: string`
+
+ - `type: "file"`
+
+ - `"file"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `stats: object { active_seconds, duration_seconds }`
+
+ Timing statistics for a session.
+
+ - `active_seconds: optional number`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `duration_seconds: optional number`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `status: "rescheduling" or "running" or "idle" or "terminated"`
+
+ SessionStatus enum
+
+ - `"rescheduling"`
+
+ - `"running"`
+
+ - `"idle"`
+
+ - `"terminated"`
+
+ - `title: string`
+
+ - `type: "session"`
+
+ - `"session"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `usage: object { cache_creation, cache_read_input_tokens, input_tokens, output_tokens }`
+
+ Cumulative token usage for a session across all turns.
+
+ - `cache_creation: optional object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `ephemeral_1h_input_tokens: optional number`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `ephemeral_5m_input_tokens: optional number`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `cache_read_input_tokens: optional number`
+
+ Total tokens read from prompt cache.
+
+ - `input_tokens: optional number`
+
+ Total input tokens consumed across all turns.
+
+ - `output_tokens: optional number`
+
+ Total output tokens generated across all turns.
+
+ - `vault_ids: array of string`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```cli
+ant beta:sessions update \
+ --api-key my-anthropic-api-key \
+ --session-id sesn_011CZkZAtmR3yMPDzynEDxu7
+```
diff --git a/content/en/api/cli/beta/skills.md b/content/en/api/cli/beta/skills.md
index 491f467a9..bcc2f883d 100644
--- a/content/en/api/cli/beta/skills.md
+++ b/content/en/api/cli/beta/skills.md
@@ -1 +1,615 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Skills
+
+## Create
+
+`$ ant beta:skills create`
+
+**post** `/v1/skills`
+
+Create Skill
+
+### Parameters
+
+- `--display-title: optional string`
+
+ Body param: Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+- `--file: optional array of string`
+
+ Body param: Files to upload for the skill.
+
+ All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillNewResponse: object { id, created_at, display_title, 4 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+### Example
+
+```cli
+ant beta:skills create \
+ --api-key my-anthropic-api-key
+```
+
+## List
+
+`$ ant beta:skills list`
+
+**get** `/v1/skills`
+
+List Skills
+
+### Parameters
+
+- `--limit: optional number`
+
+ Query param: Number of results to return per page.
+
+ Maximum value is 100. Defaults to 20.
+
+- `--page: optional string`
+
+ Query param: Pagination token for fetching a specific page of results.
+
+ Pass the value from a previous response's `next_page` field to get the next page of results.
+
+- `--source: optional string`
+
+ Query param: Filter skills by source.
+
+ If provided, only skills from the specified source will be returned:
+
+ * `"custom"`: only return user-created skills
+ * `"anthropic"`: only return Anthropic-created skills
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListSkillsResponse: object { data, has_more, next_page }`
+
+ - `data: array of object { id, created_at, display_title, 4 more }`
+
+ List of skills.
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+ - `has_more: boolean`
+
+ Whether there are more results available.
+
+ If `true`, there are additional results that can be fetched using the `next_page` token.
+
+ - `next_page: string`
+
+ Token for fetching the next page of results.
+
+ If `null`, there are no more results available. Pass this value to the `page_token` parameter in the next request to get the next page.
+
+### Example
+
+```cli
+ant beta:skills list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:skills retrieve`
+
+**get** `/v1/skills/{skill_id}`
+
+Get Skill
+
+### Parameters
+
+- `--skill-id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillGetResponse: object { id, created_at, display_title, 4 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+### Example
+
+```cli
+ant beta:skills retrieve \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+## Delete
+
+`$ ant beta:skills delete`
+
+**delete** `/v1/skills/{skill_id}`
+
+Delete Skill
+
+### Parameters
+
+- `--skill-id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillDeleteResponse: object { id, type }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `type: string`
+
+ Deleted object type.
+
+ For Skills, this is always `"skill_deleted"`.
+
+### Example
+
+```cli
+ant beta:skills delete \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+# Versions
+
+## Create
+
+`$ ant beta:skills:versions create`
+
+**post** `/v1/skills/{skill_id}/versions`
+
+Create Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--file: optional array of string`
+
+ Body param: Files to upload for the skill.
+
+ All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionNewResponse: object { id, created_at, description, 5 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+### Example
+
+```cli
+ant beta:skills:versions create \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+## List
+
+`$ ant beta:skills:versions list`
+
+**get** `/v1/skills/{skill_id}/versions`
+
+List Skill Versions
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--page: optional string`
+
+ Query param: Optionally set to the `next_page` token from the previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListSkillVersionsResponse: object { data, has_more, next_page }`
+
+ - `data: array of object { id, created_at, description, 5 more }`
+
+ List of skill versions.
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `next_page: string`
+
+ Token to provide in as `page` in the subsequent request to retrieve the next page of data.
+
+### Example
+
+```cli
+ant beta:skills:versions list \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+## Retrieve
+
+`$ ant beta:skills:versions retrieve`
+
+**get** `/v1/skills/{skill_id}/versions/{version}`
+
+Get Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--version: string`
+
+ Path param: Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionGetResponse: object { id, created_at, description, 5 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+### Example
+
+```cli
+ant beta:skills:versions retrieve \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id \
+ --version version
+```
+
+## Delete
+
+`$ ant beta:skills:versions delete`
+
+**delete** `/v1/skills/{skill_id}/versions/{version}`
+
+Delete Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--version: string`
+
+ Path param: Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionDeleteResponse: object { id, type }`
+
+ - `id: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+ - `type: string`
+
+ Deleted object type.
+
+ For Skill Versions, this is always `"skill_version_deleted"`.
+
+### Example
+
+```cli
+ant beta:skills:versions delete \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id \
+ --version version
+```
diff --git a/content/en/api/cli/beta/skills/create.md b/content/en/api/cli/beta/skills/create.md
index 8f399abd2..2b99864c8 100644
--- a/content/en/api/cli/beta/skills/create.md
+++ b/content/en/api/cli/beta/skills/create.md
@@ -1 +1,77 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Create
+
+`$ ant beta:skills create`
+
+**post** `/v1/skills`
+
+Create Skill
+
+### Parameters
+
+- `--display-title: optional string`
+
+ Body param: Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+- `--file: optional array of string`
+
+ Body param: Files to upload for the skill.
+
+ All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillNewResponse: object { id, created_at, display_title, 4 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+### Example
+
+```cli
+ant beta:skills create \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/skills/delete.md b/content/en/api/cli/beta/skills/delete.md
index 9327077a9..29ebac763 100644
--- a/content/en/api/cli/beta/skills/delete.md
+++ b/content/en/api/cli/beta/skills/delete.md
@@ -1 +1,43 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Delete
+
+`$ ant beta:skills delete`
+
+**delete** `/v1/skills/{skill_id}`
+
+Delete Skill
+
+### Parameters
+
+- `--skill-id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillDeleteResponse: object { id, type }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `type: string`
+
+ Deleted object type.
+
+ For Skills, this is always `"skill_deleted"`.
+
+### Example
+
+```cli
+ant beta:skills delete \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
diff --git a/content/en/api/cli/beta/skills/list.md b/content/en/api/cli/beta/skills/list.md
index 88c4e9be4..2e59ace31 100644
--- a/content/en/api/cli/beta/skills/list.md
+++ b/content/en/api/cli/beta/skills/list.md
@@ -1 +1,102 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## List
+
+`$ ant beta:skills list`
+
+**get** `/v1/skills`
+
+List Skills
+
+### Parameters
+
+- `--limit: optional number`
+
+ Query param: Number of results to return per page.
+
+ Maximum value is 100. Defaults to 20.
+
+- `--page: optional string`
+
+ Query param: Pagination token for fetching a specific page of results.
+
+ Pass the value from a previous response's `next_page` field to get the next page of results.
+
+- `--source: optional string`
+
+ Query param: Filter skills by source.
+
+ If provided, only skills from the specified source will be returned:
+
+ * `"custom"`: only return user-created skills
+ * `"anthropic"`: only return Anthropic-created skills
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListSkillsResponse: object { data, has_more, next_page }`
+
+ - `data: array of object { id, created_at, display_title, 4 more }`
+
+ List of skills.
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+ - `has_more: boolean`
+
+ Whether there are more results available.
+
+ If `true`, there are additional results that can be fetched using the `next_page` token.
+
+ - `next_page: string`
+
+ Token for fetching the next page of results.
+
+ If `null`, there are no more results available. Pass this value to the `page_token` parameter in the next request to get the next page.
+
+### Example
+
+```cli
+ant beta:skills list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/skills/retrieve.md b/content/en/api/cli/beta/skills/retrieve.md
index c74c3e785..bc965afd1 100644
--- a/content/en/api/cli/beta/skills/retrieve.md
+++ b/content/en/api/cli/beta/skills/retrieve.md
@@ -1 +1,72 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Retrieve
+
+`$ ant beta:skills retrieve`
+
+**get** `/v1/skills/{skill_id}`
+
+Get Skill
+
+### Parameters
+
+- `--skill-id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillGetResponse: object { id, created_at, display_title, 4 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill was created.
+
+ - `display_title: string`
+
+ Display title for the skill.
+
+ This is a human-readable label that is not included in the prompt sent to the model.
+
+ - `latest_version: string`
+
+ The latest version identifier for the skill.
+
+ This represents the most recent version of the skill that has been created.
+
+ - `source: string`
+
+ Source of the skill.
+
+ This may be one of the following values:
+
+ * `"custom"`: the skill was created by a user
+ * `"anthropic"`: the skill was created by Anthropic
+
+ - `type: string`
+
+ Object type.
+
+ For Skills, this is always `"skill"`.
+
+ - `updated_at: string`
+
+ ISO 8601 timestamp of when the skill was last updated.
+
+### Example
+
+```cli
+ant beta:skills retrieve \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
diff --git a/content/en/api/cli/beta/skills/versions.md b/content/en/api/cli/beta/skills/versions.md
index 816fde711..847ca95c1 100644
--- a/content/en/api/cli/beta/skills/versions.md
+++ b/content/en/api/cli/beta/skills/versions.md
@@ -1 +1,315 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Versions
+
+## Create
+
+`$ ant beta:skills:versions create`
+
+**post** `/v1/skills/{skill_id}/versions`
+
+Create Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--file: optional array of string`
+
+ Body param: Files to upload for the skill.
+
+ All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionNewResponse: object { id, created_at, description, 5 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+### Example
+
+```cli
+ant beta:skills:versions create \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+## List
+
+`$ ant beta:skills:versions list`
+
+**get** `/v1/skills/{skill_id}/versions`
+
+List Skill Versions
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--page: optional string`
+
+ Query param: Optionally set to the `next_page` token from the previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListSkillVersionsResponse: object { data, has_more, next_page }`
+
+ - `data: array of object { id, created_at, description, 5 more }`
+
+ List of skill versions.
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `next_page: string`
+
+ Token to provide in as `page` in the subsequent request to retrieve the next page of data.
+
+### Example
+
+```cli
+ant beta:skills:versions list \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
+
+## Retrieve
+
+`$ ant beta:skills:versions retrieve`
+
+**get** `/v1/skills/{skill_id}/versions/{version}`
+
+Get Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--version: string`
+
+ Path param: Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionGetResponse: object { id, created_at, description, 5 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+### Example
+
+```cli
+ant beta:skills:versions retrieve \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id \
+ --version version
+```
+
+## Delete
+
+`$ ant beta:skills:versions delete`
+
+**delete** `/v1/skills/{skill_id}/versions/{version}`
+
+Delete Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--version: string`
+
+ Path param: Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionDeleteResponse: object { id, type }`
+
+ - `id: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+ - `type: string`
+
+ Deleted object type.
+
+ For Skill Versions, this is always `"skill_version_deleted"`.
+
+### Example
+
+```cli
+ant beta:skills:versions delete \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id \
+ --version version
+```
diff --git a/content/en/api/cli/beta/skills/versions/create.md b/content/en/api/cli/beta/skills/versions/create.md
index 6c7c84078..ff6e0d825 100644
--- a/content/en/api/cli/beta/skills/versions/create.md
+++ b/content/en/api/cli/beta/skills/versions/create.md
@@ -1 +1,81 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Create
+
+`$ ant beta:skills:versions create`
+
+**post** `/v1/skills/{skill_id}/versions`
+
+Create Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--file: optional array of string`
+
+ Body param: Files to upload for the skill.
+
+ All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionNewResponse: object { id, created_at, description, 5 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+### Example
+
+```cli
+ant beta:skills:versions create \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
diff --git a/content/en/api/cli/beta/skills/versions/delete.md b/content/en/api/cli/beta/skills/versions/delete.md
index 1026c1b06..44eca6ac9 100644
--- a/content/en/api/cli/beta/skills/versions/delete.md
+++ b/content/en/api/cli/beta/skills/versions/delete.md
@@ -1 +1,50 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Delete
+
+`$ ant beta:skills:versions delete`
+
+**delete** `/v1/skills/{skill_id}/versions/{version}`
+
+Delete Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--version: string`
+
+ Path param: Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionDeleteResponse: object { id, type }`
+
+ - `id: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+ - `type: string`
+
+ Deleted object type.
+
+ For Skill Versions, this is always `"skill_version_deleted"`.
+
+### Example
+
+```cli
+ant beta:skills:versions delete \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id \
+ --version version
+```
diff --git a/content/en/api/cli/beta/skills/versions/list.md b/content/en/api/cli/beta/skills/versions/list.md
index 1ddd29677..0a3f78020 100644
--- a/content/en/api/cli/beta/skills/versions/list.md
+++ b/content/en/api/cli/beta/skills/versions/list.md
@@ -1 +1,97 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## List
+
+`$ ant beta:skills:versions list`
+
+**get** `/v1/skills/{skill_id}/versions`
+
+List Skill Versions
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--page: optional string`
+
+ Query param: Optionally set to the `next_page` token from the previous response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaListSkillVersionsResponse: object { data, has_more, next_page }`
+
+ - `data: array of object { id, created_at, description, 5 more }`
+
+ List of skill versions.
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `next_page: string`
+
+ Token to provide in as `page` in the subsequent request to retrieve the next page of data.
+
+### Example
+
+```cli
+ant beta:skills:versions list \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id
+```
diff --git a/content/en/api/cli/beta/skills/versions/retrieve.md b/content/en/api/cli/beta/skills/versions/retrieve.md
index 17cfea617..e1b5fd434 100644
--- a/content/en/api/cli/beta/skills/versions/retrieve.md
+++ b/content/en/api/cli/beta/skills/versions/retrieve.md
@@ -1 +1,82 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Retrieve
+
+`$ ant beta:skills:versions retrieve`
+
+**get** `/v1/skills/{skill_id}/versions/{version}`
+
+Get Skill Version
+
+### Parameters
+
+- `--skill-id: string`
+
+ Path param: Unique identifier for the skill.
+
+ The format and length of IDs may change over time.
+
+- `--version: string`
+
+ Path param: Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaSkillVersionGetResponse: object { id, created_at, description, 5 more }`
+
+ - `id: string`
+
+ Unique identifier for the skill version.
+
+ The format and length of IDs may change over time.
+
+ - `created_at: string`
+
+ ISO 8601 timestamp of when the skill version was created.
+
+ - `description: string`
+
+ Description of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `directory: string`
+
+ Directory name of the skill version.
+
+ This is the top-level directory name that was extracted from the uploaded files.
+
+ - `name: string`
+
+ Human-readable name of the skill version.
+
+ This is extracted from the SKILL.md file in the skill upload.
+
+ - `skill_id: string`
+
+ Identifier for the skill that this version belongs to.
+
+ - `type: string`
+
+ Object type.
+
+ For Skill Versions, this is always `"skill_version"`.
+
+ - `version: string`
+
+ Version identifier for the skill.
+
+ Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
+
+### Example
+
+```cli
+ant beta:skills:versions retrieve \
+ --api-key my-anthropic-api-key \
+ --skill-id skill_id \
+ --version version
+```
diff --git a/content/en/api/cli/beta/vaults.md b/content/en/api/cli/beta/vaults.md
new file mode 100644
index 000000000..c82e18caa
--- /dev/null
+++ b/content/en/api/cli/beta/vaults.md
@@ -0,0 +1,1881 @@
+# Vaults
+
+## Create
+
+`$ ant beta:vaults create`
+
+**post** `/v1/vaults`
+
+Create Vault
+
+### Parameters
+
+- `--display-name: string`
+
+ Body param: Human-readable name for the vault. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata to attach to the vault.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults create \
+ --api-key my-anthropic-api-key \
+ --display-name 'Example vault'
+```
+
+## List
+
+`$ ant beta:vaults list`
+
+**get** `/v1/vaults`
+
+List Vaults
+
+### Parameters
+
+- `--include-archived: optional boolean`
+
+ Query param: Whether to include archived vaults in the results.
+
+- `--limit: optional number`
+
+ Query param: Maximum number of vaults to return per page. Defaults to 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination token from a previous `list_vaults` response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListVaultsResponse: object { data, next_page }`
+
+ Response containing a paginated list of vaults.
+
+ - `data: optional array of BetaManagedAgentsVault`
+
+ List of vaults.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `next_page: optional string`
+
+ Pagination token for the next page, or null if no more results.
+
+### Example
+
+```cli
+ant beta:vaults list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant beta:vaults retrieve`
+
+**get** `/v1/vaults/{vault_id}`
+
+Get Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults retrieve \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Update
+
+`$ ant beta:vaults update`
+
+**post** `/v1/vaults/{vault_id}`
+
+Update Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--display-name: optional string`
+
+ Body param: Updated human-readable name for the vault. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults update \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Delete
+
+`$ ant beta:vaults delete`
+
+**delete** `/v1/vaults/{vault_id}`
+
+Delete Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_vault: object { id, type }`
+
+ Confirmation of a deleted vault.
+
+ - `id: string`
+
+ Unique identifier of the deleted vault.
+
+ - `type: "vault_deleted"`
+
+ - `"vault_deleted"`
+
+### Example
+
+```cli
+ant beta:vaults delete \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Archive
+
+`$ ant beta:vaults archive`
+
+**post** `/v1/vaults/{vault_id}/archive`
+
+Archive Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults archive \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Domain Types
+
+### Beta Managed Agents Deleted Vault
+
+- `beta_managed_agents_deleted_vault: object { id, type }`
+
+ Confirmation of a deleted vault.
+
+ - `id: string`
+
+ Unique identifier of the deleted vault.
+
+ - `type: "vault_deleted"`
+
+ - `"vault_deleted"`
+
+### Beta Managed Agents Vault
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+# Credentials
+
+## Create
+
+`$ ant beta:vaults:credentials create`
+
+**post** `/v1/vaults/{vault_id}/credentials`
+
+Create Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--auth: BetaManagedAgentsMCPOAuthCreateParams or BetaManagedAgentsStaticBearerCreateParams`
+
+ Body param: Authentication details for creating a credential.
+
+- `--display-name: optional string`
+
+ Body param: Human-readable name for the credential. Up to 255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata to attach to the credential.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials create \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --auth '{token: bearer_exampletoken, mcp_server_url: https://example-server.modelcontextprotocol.io/sse, type: static_bearer}'
+```
+
+## List
+
+`$ ant beta:vaults:credentials list`
+
+**get** `/v1/vaults/{vault_id}/credentials`
+
+List Credentials
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--include-archived: optional boolean`
+
+ Query param: Whether to include archived credentials in the results.
+
+- `--limit: optional number`
+
+ Query param: Maximum number of credentials to return per page. Defaults to 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination token from a previous `list_credentials` response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListCredentialsResponse: object { data, next_page }`
+
+ Response containing a paginated list of credentials.
+
+ - `data: optional array of BetaManagedAgentsCredential`
+
+ List of credentials.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+ - `next_page: optional string`
+
+ Pagination token for the next page, or null if no more results.
+
+### Example
+
+```cli
+ant beta:vaults:credentials list \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Retrieve
+
+`$ ant beta:vaults:credentials retrieve`
+
+**get** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Get Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials retrieve \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Update
+
+`$ ant beta:vaults:credentials update`
+
+**post** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Update Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--auth: optional BetaManagedAgentsMCPOAuthUpdateParams or BetaManagedAgentsStaticBearerUpdateParams`
+
+ Body param: Updated authentication details for a credential.
+
+- `--display-name: optional string`
+
+ Body param: Updated human-readable name for the credential. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials update \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Delete
+
+`$ ant beta:vaults:credentials delete`
+
+**delete** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Delete Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_credential: object { id, type }`
+
+ Confirmation of a deleted credential.
+
+ - `id: string`
+
+ Unique identifier of the deleted credential.
+
+ - `type: "vault_credential_deleted"`
+
+ - `"vault_credential_deleted"`
+
+### Example
+
+```cli
+ant beta:vaults:credentials delete \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Archive
+
+`$ ant beta:vaults:credentials archive`
+
+**post** `/v1/vaults/{vault_id}/credentials/{credential_id}/archive`
+
+Archive Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials archive \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Domain Types
+
+### Beta Managed Agents Credential
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Beta Managed Agents Deleted Credential
+
+- `beta_managed_agents_deleted_credential: object { id, type }`
+
+ Confirmation of a deleted credential.
+
+ - `id: string`
+
+ Unique identifier of the deleted credential.
+
+ - `type: "vault_credential_deleted"`
+
+ - `"vault_credential_deleted"`
+
+### Beta Managed Agents MCP OAuth Auth Response
+
+- `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Create Params
+
+- `beta_managed_agents_mcp_oauth_create_params: object { access_token, mcp_server_url, type, 2 more }`
+
+ Parameters for creating an MCP OAuth credential.
+
+ - `access_token: string`
+
+ OAuth access token.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, refresh_token, token_endpoint, 3 more }`
+
+ OAuth refresh token parameters for creating a credential with refresh support.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `refresh_token: string`
+
+ OAuth refresh token.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneParam or BetaManagedAgentsTokenEndpointAuthBasicParam or BetaManagedAgentsTokenEndpointAuthPostParam`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Params
+
+- `beta_managed_agents_mcp_oauth_refresh_params: object { client_id, refresh_token, token_endpoint, 3 more }`
+
+ OAuth refresh token parameters for creating a credential with refresh support.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `refresh_token: string`
+
+ OAuth refresh token.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneParam or BetaManagedAgentsTokenEndpointAuthBasicParam or BetaManagedAgentsTokenEndpointAuthPostParam`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Response
+
+- `beta_managed_agents_mcp_oauth_refresh_response: object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Update Params
+
+- `beta_managed_agents_mcp_oauth_refresh_update_params: object { refresh_token, scope, token_endpoint_auth }`
+
+ Parameters for updating OAuth refresh token configuration.
+
+ - `refresh_token: optional string`
+
+ Updated OAuth refresh token.
+
+ - `scope: optional string`
+
+ Updated OAuth scope for the refresh request.
+
+ - `token_endpoint_auth: optional BetaManagedAgentsTokenEndpointAuthBasicUpdateParam or BetaManagedAgentsTokenEndpointAuthPostUpdateParam`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+ - `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents MCP OAuth Update Params
+
+- `beta_managed_agents_mcp_oauth_update_params: object { type, access_token, expires_at, refresh }`
+
+ Parameters for updating an MCP OAuth credential. The `mcp_server_url` is immutable.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `access_token: optional string`
+
+ Updated OAuth access token.
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { refresh_token, scope, token_endpoint_auth }`
+
+ Parameters for updating OAuth refresh token configuration.
+
+ - `refresh_token: optional string`
+
+ Updated OAuth refresh token.
+
+ - `scope: optional string`
+
+ Updated OAuth scope for the refresh request.
+
+ - `token_endpoint_auth: optional BetaManagedAgentsTokenEndpointAuthBasicUpdateParam or BetaManagedAgentsTokenEndpointAuthPostUpdateParam`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+ - `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents Static Bearer Auth Response
+
+- `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+### Beta Managed Agents Static Bearer Create Params
+
+- `beta_managed_agents_static_bearer_create_params: object { token, mcp_server_url, type }`
+
+ Parameters for creating a static bearer token credential.
+
+ - `token: string`
+
+ Static bearer token value.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+### Beta Managed Agents Static Bearer Update Params
+
+- `beta_managed_agents_static_bearer_update_params: object { type, token }`
+
+ Parameters for updating a static bearer token credential. The `mcp_server_url` is immutable.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `token: optional string`
+
+ Updated static bearer token value.
+
+### Beta Managed Agents Token Endpoint Auth Basic Param
+
+- `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+### Beta Managed Agents Token Endpoint Auth Basic Response
+
+- `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+### Beta Managed Agents Token Endpoint Auth Basic Update Param
+
+- `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents Token Endpoint Auth None Param
+
+- `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+### Beta Managed Agents Token Endpoint Auth None Response
+
+- `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+### Beta Managed Agents Token Endpoint Auth Post Param
+
+- `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+### Beta Managed Agents Token Endpoint Auth Post Response
+
+- `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+### Beta Managed Agents Token Endpoint Auth Post Update Param
+
+- `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
diff --git a/content/en/api/cli/beta/vaults/archive.md b/content/en/api/cli/beta/vaults/archive.md
new file mode 100644
index 000000000..daf03c8dd
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/archive.md
@@ -0,0 +1,59 @@
+## Archive
+
+`$ ant beta:vaults archive`
+
+**post** `/v1/vaults/{vault_id}/archive`
+
+Archive Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults archive \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
diff --git a/content/en/api/cli/beta/vaults/create.md b/content/en/api/cli/beta/vaults/create.md
new file mode 100644
index 000000000..0ee8653ee
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/create.md
@@ -0,0 +1,63 @@
+## Create
+
+`$ ant beta:vaults create`
+
+**post** `/v1/vaults`
+
+Create Vault
+
+### Parameters
+
+- `--display-name: string`
+
+ Body param: Human-readable name for the vault. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata to attach to the vault.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults create \
+ --api-key my-anthropic-api-key \
+ --display-name 'Example vault'
+```
diff --git a/content/en/api/cli/beta/vaults/credentials.md b/content/en/api/cli/beta/vaults/credentials.md
new file mode 100644
index 000000000..50fe62a80
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/credentials.md
@@ -0,0 +1,1462 @@
+# Credentials
+
+## Create
+
+`$ ant beta:vaults:credentials create`
+
+**post** `/v1/vaults/{vault_id}/credentials`
+
+Create Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--auth: BetaManagedAgentsMCPOAuthCreateParams or BetaManagedAgentsStaticBearerCreateParams`
+
+ Body param: Authentication details for creating a credential.
+
+- `--display-name: optional string`
+
+ Body param: Human-readable name for the credential. Up to 255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata to attach to the credential.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials create \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --auth '{token: bearer_exampletoken, mcp_server_url: https://example-server.modelcontextprotocol.io/sse, type: static_bearer}'
+```
+
+## List
+
+`$ ant beta:vaults:credentials list`
+
+**get** `/v1/vaults/{vault_id}/credentials`
+
+List Credentials
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--include-archived: optional boolean`
+
+ Query param: Whether to include archived credentials in the results.
+
+- `--limit: optional number`
+
+ Query param: Maximum number of credentials to return per page. Defaults to 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination token from a previous `list_credentials` response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListCredentialsResponse: object { data, next_page }`
+
+ Response containing a paginated list of credentials.
+
+ - `data: optional array of BetaManagedAgentsCredential`
+
+ List of credentials.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+ - `next_page: optional string`
+
+ Pagination token for the next page, or null if no more results.
+
+### Example
+
+```cli
+ant beta:vaults:credentials list \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
+
+## Retrieve
+
+`$ ant beta:vaults:credentials retrieve`
+
+**get** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Get Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials retrieve \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Update
+
+`$ ant beta:vaults:credentials update`
+
+**post** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Update Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--auth: optional BetaManagedAgentsMCPOAuthUpdateParams or BetaManagedAgentsStaticBearerUpdateParams`
+
+ Body param: Updated authentication details for a credential.
+
+- `--display-name: optional string`
+
+ Body param: Updated human-readable name for the credential. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials update \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Delete
+
+`$ ant beta:vaults:credentials delete`
+
+**delete** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Delete Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_credential: object { id, type }`
+
+ Confirmation of a deleted credential.
+
+ - `id: string`
+
+ Unique identifier of the deleted credential.
+
+ - `type: "vault_credential_deleted"`
+
+ - `"vault_credential_deleted"`
+
+### Example
+
+```cli
+ant beta:vaults:credentials delete \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Archive
+
+`$ ant beta:vaults:credentials archive`
+
+**post** `/v1/vaults/{vault_id}/credentials/{credential_id}/archive`
+
+Archive Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials archive \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
+
+## Domain Types
+
+### Beta Managed Agents Credential
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Beta Managed Agents Deleted Credential
+
+- `beta_managed_agents_deleted_credential: object { id, type }`
+
+ Confirmation of a deleted credential.
+
+ - `id: string`
+
+ Unique identifier of the deleted credential.
+
+ - `type: "vault_credential_deleted"`
+
+ - `"vault_credential_deleted"`
+
+### Beta Managed Agents MCP OAuth Auth Response
+
+- `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Create Params
+
+- `beta_managed_agents_mcp_oauth_create_params: object { access_token, mcp_server_url, type, 2 more }`
+
+ Parameters for creating an MCP OAuth credential.
+
+ - `access_token: string`
+
+ OAuth access token.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, refresh_token, token_endpoint, 3 more }`
+
+ OAuth refresh token parameters for creating a credential with refresh support.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `refresh_token: string`
+
+ OAuth refresh token.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneParam or BetaManagedAgentsTokenEndpointAuthBasicParam or BetaManagedAgentsTokenEndpointAuthPostParam`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Params
+
+- `beta_managed_agents_mcp_oauth_refresh_params: object { client_id, refresh_token, token_endpoint, 3 more }`
+
+ OAuth refresh token parameters for creating a credential with refresh support.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `refresh_token: string`
+
+ OAuth refresh token.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneParam or BetaManagedAgentsTokenEndpointAuthBasicParam or BetaManagedAgentsTokenEndpointAuthPostParam`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Response
+
+- `beta_managed_agents_mcp_oauth_refresh_response: object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+### Beta Managed Agents MCP OAuth Refresh Update Params
+
+- `beta_managed_agents_mcp_oauth_refresh_update_params: object { refresh_token, scope, token_endpoint_auth }`
+
+ Parameters for updating OAuth refresh token configuration.
+
+ - `refresh_token: optional string`
+
+ Updated OAuth refresh token.
+
+ - `scope: optional string`
+
+ Updated OAuth scope for the refresh request.
+
+ - `token_endpoint_auth: optional BetaManagedAgentsTokenEndpointAuthBasicUpdateParam or BetaManagedAgentsTokenEndpointAuthPostUpdateParam`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+ - `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents MCP OAuth Update Params
+
+- `beta_managed_agents_mcp_oauth_update_params: object { type, access_token, expires_at, refresh }`
+
+ Parameters for updating an MCP OAuth credential. The `mcp_server_url` is immutable.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `access_token: optional string`
+
+ Updated OAuth access token.
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { refresh_token, scope, token_endpoint_auth }`
+
+ Parameters for updating OAuth refresh token configuration.
+
+ - `refresh_token: optional string`
+
+ Updated OAuth refresh token.
+
+ - `scope: optional string`
+
+ Updated OAuth scope for the refresh request.
+
+ - `token_endpoint_auth: optional BetaManagedAgentsTokenEndpointAuthBasicUpdateParam or BetaManagedAgentsTokenEndpointAuthPostUpdateParam`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+ - `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents Static Bearer Auth Response
+
+- `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+### Beta Managed Agents Static Bearer Create Params
+
+- `beta_managed_agents_static_bearer_create_params: object { token, mcp_server_url, type }`
+
+ Parameters for creating a static bearer token credential.
+
+ - `token: string`
+
+ Static bearer token value.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+### Beta Managed Agents Static Bearer Update Params
+
+- `beta_managed_agents_static_bearer_update_params: object { type, token }`
+
+ Parameters for updating a static bearer token credential. The `mcp_server_url` is immutable.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `token: optional string`
+
+ Updated static bearer token value.
+
+### Beta Managed Agents Token Endpoint Auth Basic Param
+
+- `beta_managed_agents_token_endpoint_auth_basic_param: object { client_secret, type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+### Beta Managed Agents Token Endpoint Auth Basic Response
+
+- `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+### Beta Managed Agents Token Endpoint Auth Basic Update Param
+
+- `beta_managed_agents_token_endpoint_auth_basic_update_param: object { type, client_secret }`
+
+ Updated HTTP Basic authentication parameters for the token endpoint.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
+
+### Beta Managed Agents Token Endpoint Auth None Param
+
+- `beta_managed_agents_token_endpoint_auth_none_param: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+### Beta Managed Agents Token Endpoint Auth None Response
+
+- `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+### Beta Managed Agents Token Endpoint Auth Post Param
+
+- `beta_managed_agents_token_endpoint_auth_post_param: object { client_secret, type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `client_secret: string`
+
+ OAuth client secret.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+### Beta Managed Agents Token Endpoint Auth Post Response
+
+- `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+### Beta Managed Agents Token Endpoint Auth Post Update Param
+
+- `beta_managed_agents_token_endpoint_auth_post_update_param: object { type, client_secret }`
+
+ Updated POST body authentication parameters for the token endpoint.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `client_secret: optional string`
+
+ Updated OAuth client secret.
diff --git a/content/en/api/cli/beta/vaults/credentials/archive.md b/content/en/api/cli/beta/vaults/credentials/archive.md
new file mode 100644
index 000000000..11bde71ac
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/credentials/archive.md
@@ -0,0 +1,148 @@
+## Archive
+
+`$ ant beta:vaults:credentials archive`
+
+**post** `/v1/vaults/{vault_id}/credentials/{credential_id}/archive`
+
+Archive Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials archive \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
diff --git a/content/en/api/cli/beta/vaults/credentials/create.md b/content/en/api/cli/beta/vaults/credentials/create.md
new file mode 100644
index 000000000..b292b4577
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/credentials/create.md
@@ -0,0 +1,156 @@
+## Create
+
+`$ ant beta:vaults:credentials create`
+
+**post** `/v1/vaults/{vault_id}/credentials`
+
+Create Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--auth: BetaManagedAgentsMCPOAuthCreateParams or BetaManagedAgentsStaticBearerCreateParams`
+
+ Body param: Authentication details for creating a credential.
+
+- `--display-name: optional string`
+
+ Body param: Human-readable name for the credential. Up to 255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Arbitrary key-value metadata to attach to the credential.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials create \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --auth '{token: bearer_exampletoken, mcp_server_url: https://example-server.modelcontextprotocol.io/sse, type: static_bearer}'
+```
diff --git a/content/en/api/cli/beta/vaults/credentials/delete.md b/content/en/api/cli/beta/vaults/credentials/delete.md
new file mode 100644
index 000000000..f98f8bb0b
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/credentials/delete.md
@@ -0,0 +1,44 @@
+## Delete
+
+`$ ant beta:vaults:credentials delete`
+
+**delete** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Delete Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_credential: object { id, type }`
+
+ Confirmation of a deleted credential.
+
+ - `id: string`
+
+ Unique identifier of the deleted credential.
+
+ - `type: "vault_credential_deleted"`
+
+ - `"vault_credential_deleted"`
+
+### Example
+
+```cli
+ant beta:vaults:credentials delete \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
diff --git a/content/en/api/cli/beta/vaults/credentials/list.md b/content/en/api/cli/beta/vaults/credentials/list.md
new file mode 100644
index 000000000..b7b10167e
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/credentials/list.md
@@ -0,0 +1,163 @@
+## List
+
+`$ ant beta:vaults:credentials list`
+
+**get** `/v1/vaults/{vault_id}/credentials`
+
+List Credentials
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--include-archived: optional boolean`
+
+ Query param: Whether to include archived credentials in the results.
+
+- `--limit: optional number`
+
+ Query param: Maximum number of credentials to return per page. Defaults to 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination token from a previous `list_credentials` response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListCredentialsResponse: object { data, next_page }`
+
+ Response containing a paginated list of credentials.
+
+ - `data: optional array of BetaManagedAgentsCredential`
+
+ List of credentials.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+ - `next_page: optional string`
+
+ Pagination token for the next page, or null if no more results.
+
+### Example
+
+```cli
+ant beta:vaults:credentials list \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
diff --git a/content/en/api/cli/beta/vaults/credentials/retrieve.md b/content/en/api/cli/beta/vaults/credentials/retrieve.md
new file mode 100644
index 000000000..f28ca9bc6
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/credentials/retrieve.md
@@ -0,0 +1,148 @@
+## Retrieve
+
+`$ ant beta:vaults:credentials retrieve`
+
+**get** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Get Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials retrieve \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
diff --git a/content/en/api/cli/beta/vaults/credentials/update.md b/content/en/api/cli/beta/vaults/credentials/update.md
new file mode 100644
index 000000000..2e22a76dd
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/credentials/update.md
@@ -0,0 +1,160 @@
+## Update
+
+`$ ant beta:vaults:credentials update`
+
+**post** `/v1/vaults/{vault_id}/credentials/{credential_id}`
+
+Update Credential
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--credential-id: string`
+
+ Path param: Path parameter credential_id
+
+- `--auth: optional BetaManagedAgentsMCPOAuthUpdateParams or BetaManagedAgentsStaticBearerUpdateParams`
+
+ Body param: Updated authentication details for a credential.
+
+- `--display-name: optional string`
+
+ Body param: Updated human-readable name for the credential. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_credential: object { id, archived_at, auth, 6 more }`
+
+ A credential stored in a vault. Sensitive fields are never returned in responses.
+
+ - `id: string`
+
+ Unique identifier for the credential.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `auth: BetaManagedAgentsMCPOAuthAuthResponse or BetaManagedAgentsStaticBearerAuthResponse`
+
+ Authentication details for a credential.
+
+ - `beta_managed_agents_mcp_oauth_auth_response: object { mcp_server_url, type, expires_at, refresh }`
+
+ OAuth credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "mcp_oauth"`
+
+ - `"mcp_oauth"`
+
+ - `expires_at: optional string`
+
+ A timestamp in RFC 3339 format
+
+ - `refresh: optional object { client_id, token_endpoint, token_endpoint_auth, 2 more }`
+
+ OAuth refresh token configuration returned in credential responses.
+
+ - `client_id: string`
+
+ OAuth client ID.
+
+ - `token_endpoint: string`
+
+ Token endpoint URL used to refresh the access token.
+
+ - `token_endpoint_auth: BetaManagedAgentsTokenEndpointAuthNoneResponse or BetaManagedAgentsTokenEndpointAuthBasicResponse or BetaManagedAgentsTokenEndpointAuthPostResponse`
+
+ Token endpoint requires no client authentication.
+
+ - `beta_managed_agents_token_endpoint_auth_none_response: object { type }`
+
+ Token endpoint requires no client authentication.
+
+ - `type: "none"`
+
+ - `"none"`
+
+ - `beta_managed_agents_token_endpoint_auth_basic_response: object { type }`
+
+ Token endpoint uses HTTP Basic authentication with client credentials.
+
+ - `type: "client_secret_basic"`
+
+ - `"client_secret_basic"`
+
+ - `beta_managed_agents_token_endpoint_auth_post_response: object { type }`
+
+ Token endpoint uses POST body authentication with client credentials.
+
+ - `type: "client_secret_post"`
+
+ - `"client_secret_post"`
+
+ - `resource: optional string`
+
+ OAuth resource indicator.
+
+ - `scope: optional string`
+
+ OAuth scope for the refresh request.
+
+ - `beta_managed_agents_static_bearer_auth_response: object { mcp_server_url, type }`
+
+ Static bearer token credential details for an MCP server.
+
+ - `mcp_server_url: string`
+
+ URL of the MCP server this credential authenticates against.
+
+ - `type: "static_bearer"`
+
+ - `"static_bearer"`
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the credential.
+
+ - `type: "vault_credential"`
+
+ - `"vault_credential"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `vault_id: string`
+
+ Identifier of the vault this credential belongs to.
+
+ - `display_name: optional string`
+
+ Human-readable name for the credential.
+
+### Example
+
+```cli
+ant beta:vaults:credentials update \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv \
+ --credential-id vcrd_011CZkZEMt8gZan2iYOQfSkw
+```
diff --git a/content/en/api/cli/beta/vaults/delete.md b/content/en/api/cli/beta/vaults/delete.md
new file mode 100644
index 000000000..3ccc04b4a
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/delete.md
@@ -0,0 +1,39 @@
+## Delete
+
+`$ ant beta:vaults delete`
+
+**delete** `/v1/vaults/{vault_id}`
+
+Delete Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_deleted_vault: object { id, type }`
+
+ Confirmation of a deleted vault.
+
+ - `id: string`
+
+ Unique identifier of the deleted vault.
+
+ - `type: "vault_deleted"`
+
+ - `"vault_deleted"`
+
+### Example
+
+```cli
+ant beta:vaults delete \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
diff --git a/content/en/api/cli/beta/vaults/list.md b/content/en/api/cli/beta/vaults/list.md
new file mode 100644
index 000000000..2792e12fb
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/list.md
@@ -0,0 +1,74 @@
+## List
+
+`$ ant beta:vaults list`
+
+**get** `/v1/vaults`
+
+List Vaults
+
+### Parameters
+
+- `--include-archived: optional boolean`
+
+ Query param: Whether to include archived vaults in the results.
+
+- `--limit: optional number`
+
+ Query param: Maximum number of vaults to return per page. Defaults to 20, maximum 100.
+
+- `--page: optional string`
+
+ Query param: Opaque pagination token from a previous `list_vaults` response.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `BetaManagedAgentsListVaultsResponse: object { data, next_page }`
+
+ Response containing a paginated list of vaults.
+
+ - `data: optional array of BetaManagedAgentsVault`
+
+ List of vaults.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `next_page: optional string`
+
+ Pagination token for the next page, or null if no more results.
+
+### Example
+
+```cli
+ant beta:vaults list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/beta/vaults/retrieve.md b/content/en/api/cli/beta/vaults/retrieve.md
new file mode 100644
index 000000000..e2251a13d
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/retrieve.md
@@ -0,0 +1,59 @@
+## Retrieve
+
+`$ ant beta:vaults retrieve`
+
+**get** `/v1/vaults/{vault_id}`
+
+Get Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path parameter vault_id
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults retrieve \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
diff --git a/content/en/api/cli/beta/vaults/update.md b/content/en/api/cli/beta/vaults/update.md
new file mode 100644
index 000000000..07c37540d
--- /dev/null
+++ b/content/en/api/cli/beta/vaults/update.md
@@ -0,0 +1,67 @@
+## Update
+
+`$ ant beta:vaults update`
+
+**post** `/v1/vaults/{vault_id}`
+
+Update Vault
+
+### Parameters
+
+- `--vault-id: string`
+
+ Path param: Path parameter vault_id
+
+- `--display-name: optional string`
+
+ Body param: Updated human-readable name for the vault. 1-255 characters.
+
+- `--metadata: optional map[string]`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `beta_managed_agents_vault: object { id, archived_at, created_at, 4 more }`
+
+ A vault that stores credentials for use by agents during sessions.
+
+ - `id: string`
+
+ Unique identifier for the vault.
+
+ - `archived_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `created_at: string`
+
+ A timestamp in RFC 3339 format
+
+ - `display_name: string`
+
+ Human-readable name for the vault.
+
+ - `metadata: map[string]`
+
+ Arbitrary key-value metadata attached to the vault.
+
+ - `type: "vault"`
+
+ - `"vault"`
+
+ - `updated_at: string`
+
+ A timestamp in RFC 3339 format
+
+### Example
+
+```cli
+ant beta:vaults update \
+ --api-key my-anthropic-api-key \
+ --vault-id vlt_011CZkZDLs7fYzm1hXNPeRjv
+```
diff --git a/content/en/api/cli/completions.md b/content/en/api/cli/completions.md
index 98235cd3c..e2d7563a2 100644
--- a/content/en/api/cli/completions.md
+++ b/content/en/api/cli/completions.md
@@ -1 +1,301 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Completions
+
+## Create
+
+`$ ant completions create`
+
+**post** `/v1/complete`
+
+[Legacy] Create a Text Completion.
+
+The Text Completions API is a legacy API. We recommend using the [Messages API](https://docs.claude.com/en/api/messages) going forward.
+
+Future models and features will not be compatible with Text Completions. See our [migration guide](https://docs.claude.com/en/api/migrating-from-text-completions-to-messages) for guidance in migrating from Text Completions to Messages.
+
+### Parameters
+
+- `--max-tokens-to-sample: number`
+
+ Body param: The maximum number of tokens to generate before stopping.
+
+ Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ Body param: The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--prompt: string`
+
+ Body param: The prompt that you want Claude to complete.
+
+ For proper response generation you will need to format your prompt using alternating `
+
+ Human:`and`
+
+ Assistant:` conversational turns. For example:
+
+ ```
+ "
+
+ Human: {userQuestion}
+
+ Assistant:"
+ ```
+
+ See [prompt validation](https://docs.claude.com/en/api/prompt-validation) and our guide to [prompt design](https://docs.claude.com/en/docs/intro-to-prompting) for more details.
+
+- `--metadata: optional object { user_id }`
+
+ Body param: An object describing metadata about the request.
+
+- `--stop-sequence: optional array of string`
+
+ Body param: Sequences that will cause the model to stop generating.
+
+ Our models stop on `"
+
+ Human:"`, and may include additional built-in stop sequences in the future. By providing the stop_sequences parameter, you may include additional strings that will cause the model to stop generating.
+
+- `--temperature: optional number`
+
+ Body param: Amount of randomness injected into the response.
+
+ Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
+
+ Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
+
+- `--top-k: optional number`
+
+ Body param: Only sample from the top K options for each subsequent token.
+
+ Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--top-p: optional number`
+
+ Body param: Use nucleus sampling.
+
+ In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `completion: object { id, completion, model, 2 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `completion: string`
+
+ The resulting completion up to and excluding the stop sequences.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `stop_reason: string`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"stop_sequence"`: we reached a stop sequence — either provided by you via the `stop_sequences` parameter, or a stop sequence built into the model
+ * `"max_tokens"`: we exceeded `max_tokens_to_sample` or the model's maximum
+
+ - `type: "completion"`
+
+ Object type.
+
+ For Text Completions, this is always `"completion"`.
+
+### Example
+
+```cli
+ant completions create \
+ --api-key my-anthropic-api-key \
+ --max-tokens-to-sample 256 \
+ --model claude-mythos-preview \
+ --prompt '
+
+Human: Hello, world!
+
+Assistant:'
+```
+
+## Domain Types
+
+### Completion
+
+- `completion: object { id, completion, model, 2 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `completion: string`
+
+ The resulting completion up to and excluding the stop sequences.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `stop_reason: string`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"stop_sequence"`: we reached a stop sequence — either provided by you via the `stop_sequences` parameter, or a stop sequence built into the model
+ * `"max_tokens"`: we exceeded `max_tokens_to_sample` or the model's maximum
+
+ - `type: "completion"`
+
+ Object type.
+
+ For Text Completions, this is always `"completion"`.
diff --git a/content/en/api/cli/completions/create.md b/content/en/api/cli/completions/create.md
index eb0377b2c..85134903b 100644
--- a/content/en/api/cli/completions/create.md
+++ b/content/en/api/cli/completions/create.md
@@ -1 +1,198 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Create
+
+`$ ant completions create`
+
+**post** `/v1/complete`
+
+[Legacy] Create a Text Completion.
+
+The Text Completions API is a legacy API. We recommend using the [Messages API](https://docs.claude.com/en/api/messages) going forward.
+
+Future models and features will not be compatible with Text Completions. See our [migration guide](https://docs.claude.com/en/api/migrating-from-text-completions-to-messages) for guidance in migrating from Text Completions to Messages.
+
+### Parameters
+
+- `--max-tokens-to-sample: number`
+
+ Body param: The maximum number of tokens to generate before stopping.
+
+ Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ Body param: The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--prompt: string`
+
+ Body param: The prompt that you want Claude to complete.
+
+ For proper response generation you will need to format your prompt using alternating `
+
+ Human:`and`
+
+ Assistant:` conversational turns. For example:
+
+ ```
+ "
+
+ Human: {userQuestion}
+
+ Assistant:"
+ ```
+
+ See [prompt validation](https://docs.claude.com/en/api/prompt-validation) and our guide to [prompt design](https://docs.claude.com/en/docs/intro-to-prompting) for more details.
+
+- `--metadata: optional object { user_id }`
+
+ Body param: An object describing metadata about the request.
+
+- `--stop-sequence: optional array of string`
+
+ Body param: Sequences that will cause the model to stop generating.
+
+ Our models stop on `"
+
+ Human:"`, and may include additional built-in stop sequences in the future. By providing the stop_sequences parameter, you may include additional strings that will cause the model to stop generating.
+
+- `--temperature: optional number`
+
+ Body param: Amount of randomness injected into the response.
+
+ Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
+
+ Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
+
+- `--top-k: optional number`
+
+ Body param: Only sample from the top K options for each subsequent token.
+
+ Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--top-p: optional number`
+
+ Body param: Use nucleus sampling.
+
+ In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `completion: object { id, completion, model, 2 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `completion: string`
+
+ The resulting completion up to and excluding the stop sequences.
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `stop_reason: string`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"stop_sequence"`: we reached a stop sequence — either provided by you via the `stop_sequences` parameter, or a stop sequence built into the model
+ * `"max_tokens"`: we exceeded `max_tokens_to_sample` or the model's maximum
+
+ - `type: "completion"`
+
+ Object type.
+
+ For Text Completions, this is always `"completion"`.
+
+### Example
+
+```cli
+ant completions create \
+ --api-key my-anthropic-api-key \
+ --max-tokens-to-sample 256 \
+ --model claude-mythos-preview \
+ --prompt '
+
+Human: Hello, world!
+
+Assistant:'
+```
diff --git a/content/en/api/cli/messages.md b/content/en/api/cli/messages.md
index ee46967ae..4509829b4 100644
--- a/content/en/api/cli/messages.md
+++ b/content/en/api/cli/messages.md
@@ -1 +1,21779 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Messages
+
+## Create
+
+`$ ant messages create`
+
+**post** `/v1/messages`
+
+Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
+
+The Messages API can be used for either single queries or stateless multi-turn conversations.
+
+Learn more about the Messages API in our [user guide](https://docs.claude.com/en/docs/initial-setup)
+
+### Parameters
+
+- `--max-tokens: number`
+
+ The maximum number of tokens to generate before stopping.
+
+ Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
+
+ Different models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details.
+
+- `--message: array of MessageParam`
+
+ Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--container: optional string`
+
+ Container identifier for reuse across requests.
+
+- `--inference-geo: optional string`
+
+ Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.
+
+- `--metadata: optional object { user_id }`
+
+ An object describing metadata about the request.
+
+- `--output-config: optional object { effort, format }`
+
+ Configuration options for the model's output, such as the output format.
+
+- `--service-tier: optional "auto" or "standard_only"`
+
+ Determines whether to use priority capacity (if available) or standard capacity for this request.
+
+ Anthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
+
+- `--stop-sequence: optional array of string`
+
+ Custom text sequences that will cause the model to stop generating.
+
+ Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
+
+ If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.
+
+- `--system: optional string or array of TextBlockParam`
+
+ System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--temperature: optional number`
+
+ Amount of randomness injected into the response.
+
+ Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
+
+ Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
+
+- `--thinking: optional ThinkingConfigEnabled or ThinkingConfigDisabled or ThinkingConfigAdaptive`
+
+ Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional ToolChoiceAuto or ToolChoiceAny or ToolChoiceTool or ToolChoiceNone`
+
+ How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of ToolUnion`
+
+ Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+- `--top-k: optional number`
+
+ Only sample from the top K options for each subsequent token.
+
+ Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--top-p: optional number`
+
+ Use nucleus sampling.
+
+ In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+### Returns
+
+- `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+### Example
+
+```cli
+ant messages create \
+ --api-key my-anthropic-api-key \
+ --max-tokens 1024 \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-opus-4-6
+```
+
+## Count Tokens
+
+`$ ant messages count-tokens`
+
+**post** `/v1/messages/count_tokens`
+
+Count the number of tokens in a Message.
+
+The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.
+
+Learn more about token counting in our [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
+
+### Parameters
+
+- `--message: array of MessageParam`
+
+ Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--output-config: optional object { effort, format }`
+
+ Configuration options for the model's output, such as the output format.
+
+- `--system: optional string or array of TextBlockParam`
+
+ System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--thinking: optional ThinkingConfigEnabled or ThinkingConfigDisabled or ThinkingConfigAdaptive`
+
+ Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional ToolChoiceAuto or ToolChoiceAny or ToolChoiceTool or ToolChoiceNone`
+
+ How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of MessageCountTokensTool`
+
+ Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+### Returns
+
+- `message_tokens_count: object { input_tokens }`
+
+ - `input_tokens: number`
+
+ The total number of tokens across the provided list of messages, system prompt, and tools.
+
+### Example
+
+```cli
+ant messages count-tokens \
+ --api-key my-anthropic-api-key \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-mythos-preview
+```
+
+## Domain Types
+
+### Base64 Image Source
+
+- `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+### Base64 PDF Source
+
+- `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+### Bash Code Execution Output Block
+
+- `bash_code_execution_output_block: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+### Bash Code Execution Output Block Param
+
+- `bash_code_execution_output_block_param: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+### Bash Code Execution Result Block
+
+- `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+### Bash Code Execution Result Block Param
+
+- `bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+### Bash Code Execution Tool Result Block
+
+- `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+### Bash Code Execution Tool Result Block Param
+
+- `bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
+
+ - `bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Bash Code Execution Tool Result Error
+
+- `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+### Bash Code Execution Tool Result Error Code
+
+- `bash_code_execution_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+### Bash Code Execution Tool Result Error Param
+
+- `bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+### Cache Control Ephemeral
+
+- `cache_control_ephemeral: object { type, ttl }`
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Cache Creation
+
+- `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+### Citation Char Location
+
+- `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+### Citation Char Location Param
+
+- `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+### Citation Content Block Location
+
+- `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+### Citation Content Block Location Param
+
+- `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+### Citation Page Location
+
+- `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+### Citation Page Location Param
+
+- `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+### Citation Search Result Location Param
+
+- `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Citation Web Search Result Location Param
+
+- `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+### Citations Config
+
+- `citations_config: object { enabled }`
+
+ - `enabled: boolean`
+
+### Citations Config Param
+
+- `citations_config_param: object { enabled }`
+
+ - `enabled: optional boolean`
+
+### Citations Delta
+
+- `citations_delta: object { citation, type }`
+
+ - `citation: CitationCharLocation or CitationPageLocation or CitationContentBlockLocation or 2 more`
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+### Citations Search Result Location
+
+- `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Citations Web Search Result Location
+
+- `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+### Code Execution Output Block
+
+- `code_execution_output_block: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+### Code Execution Output Block Param
+
+- `code_execution_output_block_param: object { file_id, type }`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+### Code Execution Result Block
+
+- `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+### Code Execution Result Block Param
+
+- `code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+### Code Execution Tool 20250522
+
+- `code_execution_tool_20250522: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250522"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Code Execution Tool 20250825
+
+- `code_execution_tool_20250825: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250825"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Code Execution Tool 20260120
+
+- `code_execution_tool_20260120: object { name, type, allowed_callers, 3 more }`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20260120"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Code Execution Tool Result Block
+
+- `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+### Code Execution Tool Result Block Content
+
+- `code_execution_tool_result_block_content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Code Execution Tool Result Block Param
+
+- `code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: CodeExecutionToolResultErrorParam or CodeExecutionResultBlockParam or EncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Code Execution Tool Result Block Param Content
+
+- `code_execution_tool_result_block_param_content: CodeExecutionToolResultErrorParam or CodeExecutionResultBlockParam or EncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Code Execution Tool Result Error
+
+- `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+### Code Execution Tool Result Error Code
+
+- `code_execution_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+### Code Execution Tool Result Error Param
+
+- `code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+### Container
+
+- `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+### Container Upload Block
+
+- `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+### Container Upload Block Param
+
+- `container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Content Block
+
+- `content_block: TextBlock or ThinkingBlock or RedactedThinkingBlock or 9 more`
+
+ Response model for a file uploaded to the container.
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+### Content Block Param
+
+- `content_block_param: TextBlockParam or ImageBlockParam or DocumentBlockParam or 13 more`
+
+ Regular text content.
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `document_block_param: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of TextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 2 more`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of TextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `document_block_param: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+ - `server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of WebSearchResultBlockParam or WebSearchToolRequestError`
+
+ - `web_search_tool_result_block_item: array of WebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
+
+ - `web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: CodeExecutionToolResultErrorParam or CodeExecutionResultBlockParam or EncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
+
+ - `bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
+
+ - `tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Content Block Source
+
+- `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+### Content Block Source Content
+
+- `content_block_source_content: TextBlockParam or ImageBlockParam`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Direct Caller
+
+- `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+### Document Block
+
+- `document_block: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+### Document Block Param
+
+- `document_block_param: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+### Encrypted Code Execution Result Block
+
+- `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Encrypted Code Execution Result Block Param
+
+- `encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+### Image Block Param
+
+- `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Input JSON Delta
+
+- `input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+### JSON Output Format
+
+- `json_output_format: object { schema, type }`
+
+ - `schema: map[unknown]`
+
+ The JSON schema of the format
+
+ - `type: "json_schema"`
+
+### Memory Tool 20250818
+
+- `memory_tool_20250818: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "memory"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "memory_20250818"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Message
+
+- `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+### Message Count Tokens Tool
+
+- `message_count_tokens_tool: Tool or ToolBash20250124 or CodeExecutionTool20250522 or 13 more`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `tool: object { input_schema, name, allowed_callers, 7 more }`
+
+ - `input_schema: object { type, properties, required }`
+
+ [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
+
+ This defines the shape of the `input` that your tool accepts and that the model will produce.
+
+ - `type: "object"`
+
+ - `properties: optional map[unknown]`
+
+ - `required: optional array of string`
+
+ - `name: string`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `description: optional string`
+
+ Description of what this tool does.
+
+ Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
+
+ - `eager_input_streaming: optional boolean`
+
+ Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `type: optional "custom"`
+
+ - `"custom"`
+
+ - `tool_bash_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `code_execution_tool_20250522: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250522"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `code_execution_tool_20250825: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250825"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `code_execution_tool_20260120: object { name, type, allowed_callers, 3 more }`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20260120"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `memory_tool_20250818: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "memory"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "memory_20250818"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `tool_text_editor_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `tool_text_editor_20250429: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250429"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `tool_text_editor_20250728: object { name, type, allowed_callers, 5 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250728"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `max_characters: optional number`
+
+ Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `web_search_tool_20250305: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20250305"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+ - `web_fetch_tool_20250910: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20250910"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `web_search_tool_20260209: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+ - `web_fetch_tool_20260209: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `web_fetch_tool_20260309: object { name, type, allowed_callers, 9 more }`
+
+ Web fetch tool with use_cache parameter for bypassing cached content.
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260309"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `use_cache: optional boolean`
+
+ Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
+
+ - `tool_search_tool_bm25_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_bm25"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
+
+ - `"tool_search_tool_bm25_20251119"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `tool_search_tool_regex_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_regex"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
+
+ - `"tool_search_tool_regex_20251119"`
+
+ - `"tool_search_tool_regex"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Message Delta Usage
+
+- `message_delta_usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Message Param
+
+- `message_param: object { content, role }`
+
+ - `content: array of ContentBlockParam`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `document_block_param: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of TextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 2 more`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of TextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `document_block_param: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+ - `server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of WebSearchResultBlockParam or WebSearchToolRequestError`
+
+ - `web_search_tool_result_block_item: array of WebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
+
+ - `web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: CodeExecutionToolResultErrorParam or CodeExecutionResultBlockParam or EncryptedCodeExecutionResultBlockParam`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block_param: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `bash_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: BashCodeExecutionToolResultErrorParam or BashCodeExecutionResultBlockParam`
+
+ - `bash_code_execution_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block_param: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlockParam`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
+
+ - `tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `container_upload_block_param: object { file_id, type, cache_control }`
+
+ A content block that represents a file to be uploaded to the container
+ Files uploaded via this block will be available in the container's input directory.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `role: "user" or "assistant"`
+
+ - `"user"`
+
+ - `"assistant"`
+
+### Message Tokens Count
+
+- `message_tokens_count: object { input_tokens }`
+
+ - `input_tokens: number`
+
+ The total number of tokens across the provided list of messages, system prompt, and tools.
+
+### Metadata
+
+- `metadata: object { user_id }`
+
+ - `user_id: optional string`
+
+ An external identifier for the user who is associated with the request.
+
+ This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
+
+### Output Config
+
+- `output_config: object { effort, format }`
+
+ - `effort: optional "low" or "medium" or "high" or "max"`
+
+ All possible effort levels.
+
+ - `"low"`
+
+ - `"medium"`
+
+ - `"high"`
+
+ - `"max"`
+
+ - `format: optional object { schema, type }`
+
+ A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
+
+ - `schema: map[unknown]`
+
+ The JSON schema of the format
+
+ - `type: "json_schema"`
+
+### Plain Text Source
+
+- `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+### Raw Content Block Delta
+
+- `raw_content_block_delta: TextDelta or InputJSONDelta or CitationsDelta or 2 more`
+
+ - `text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `citations_delta: object { citation, type }`
+
+ - `citation: CitationCharLocation or CitationPageLocation or CitationContentBlockLocation or 2 more`
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+### Raw Content Block Delta Event
+
+- `raw_content_block_delta_event: object { delta, index, type }`
+
+ - `delta: TextDelta or InputJSONDelta or CitationsDelta or 2 more`
+
+ - `text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `citations_delta: object { citation, type }`
+
+ - `citation: CitationCharLocation or CitationPageLocation or CitationContentBlockLocation or 2 more`
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+ - `index: number`
+
+ - `type: "content_block_delta"`
+
+### Raw Content Block Start Event
+
+- `raw_content_block_start_event: object { content_block, index, type }`
+
+ - `content_block: TextBlock or ThinkingBlock or RedactedThinkingBlock or 9 more`
+
+ Response model for a file uploaded to the container.
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `index: number`
+
+ - `type: "content_block_start"`
+
+### Raw Content Block Stop Event
+
+- `raw_content_block_stop_event: object { index, type }`
+
+ - `index: number`
+
+ - `type: "content_block_stop"`
+
+### Raw Message Delta Event
+
+- `raw_message_delta_event: object { delta, type, usage }`
+
+ - `delta: object { container, stop_details, stop_reason, stop_sequence }`
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ - `type: "message_delta"`
+
+ - `usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Raw Message Start Event
+
+- `raw_message_start_event: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "message_start"`
+
+### Raw Message Stop Event
+
+- `raw_message_stop_event: object { type }`
+
+ - `type: "message_stop"`
+
+### Raw Message Stream Event
+
+- `raw_message_stream_event: RawMessageStartEvent or RawMessageDeltaEvent or RawMessageStopEvent or 3 more`
+
+ - `raw_message_start_event: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "message_start"`
+
+ - `raw_message_delta_event: object { delta, type, usage }`
+
+ - `delta: object { container, stop_details, stop_reason, stop_sequence }`
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ - `type: "message_delta"`
+
+ - `usage: object { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation_input_tokens: number`
+
+ The cumulative number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The cumulative number of input tokens read from the cache.
+
+ - `input_tokens: number`
+
+ The cumulative number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The cumulative number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `raw_message_stop_event: object { type }`
+
+ - `type: "message_stop"`
+
+ - `raw_content_block_start_event: object { content_block, index, type }`
+
+ - `content_block: TextBlock or ThinkingBlock or RedactedThinkingBlock or 9 more`
+
+ Response model for a file uploaded to the container.
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `index: number`
+
+ - `type: "content_block_start"`
+
+ - `raw_content_block_delta_event: object { delta, index, type }`
+
+ - `delta: TextDelta or InputJSONDelta or CitationsDelta or 2 more`
+
+ - `text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+ - `input_json_delta: object { partial_json, type }`
+
+ - `partial_json: string`
+
+ - `type: "input_json_delta"`
+
+ - `citations_delta: object { citation, type }`
+
+ - `citation: CitationCharLocation or CitationPageLocation or CitationContentBlockLocation or 2 more`
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `type: "citations_delta"`
+
+ - `thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+ - `signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+ - `index: number`
+
+ - `type: "content_block_delta"`
+
+ - `raw_content_block_stop_event: object { index, type }`
+
+ - `index: number`
+
+ - `type: "content_block_stop"`
+
+### Redacted Thinking Block
+
+- `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+### Redacted Thinking Block Param
+
+- `redacted_thinking_block_param: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+### Refusal Stop Details
+
+- `refusal_stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+### Search Result Block Param
+
+- `search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of TextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+### Server Tool Caller
+
+- `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+### Server Tool Caller 20260120
+
+- `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Server Tool Usage
+
+- `server_tool_usage: object { web_fetch_requests, web_search_requests }`
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+### Server Tool Use Block
+
+- `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+### Server Tool Use Block Param
+
+- `server_tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Signature Delta
+
+- `signature_delta: object { signature, type }`
+
+ - `signature: string`
+
+ - `type: "signature_delta"`
+
+### Stop Reason
+
+- `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+### Text Block
+
+- `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+### Text Block Param
+
+- `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Text Citation
+
+- `text_citation: CitationCharLocation or CitationPageLocation or CitationContentBlockLocation or 2 more`
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Text Citation Param
+
+- `text_citation_param: CitationCharLocationParam or CitationPageLocationParam or CitationContentBlockLocationParam or 2 more`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+### Text Delta
+
+- `text_delta: object { text, type }`
+
+ - `text: string`
+
+ - `type: "text_delta"`
+
+### Text Editor Code Execution Create Result Block
+
+- `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+### Text Editor Code Execution Create Result Block Param
+
+- `text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+### Text Editor Code Execution Str Replace Result Block
+
+- `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+### Text Editor Code Execution Str Replace Result Block Param
+
+- `text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+### Text Editor Code Execution Tool Result Block
+
+- `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+### Text Editor Code Execution Tool Result Block Param
+
+- `text_editor_code_execution_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: TextEditorCodeExecutionToolResultErrorParam or TextEditorCodeExecutionViewResultBlockParam or TextEditorCodeExecutionCreateResultBlockParam or TextEditorCodeExecutionStrReplaceResultBlockParam`
+
+ - `text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+ - `text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+ - `text_editor_code_execution_create_result_block_param: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block_param: object { type, lines, new_lines, 3 more }`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `lines: optional array of string`
+
+ - `new_lines: optional number`
+
+ - `new_start: optional number`
+
+ - `old_lines: optional number`
+
+ - `old_start: optional number`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Text Editor Code Execution Tool Result Error
+
+- `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+### Text Editor Code Execution Tool Result Error Code
+
+- `text_editor_code_execution_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+### Text Editor Code Execution Tool Result Error Param
+
+- `text_editor_code_execution_tool_result_error_param: object { error_code, type, error_message }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `error_message: optional string`
+
+### Text Editor Code Execution View Result Block
+
+- `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+### Text Editor Code Execution View Result Block Param
+
+- `text_editor_code_execution_view_result_block_param: object { content, file_type, type, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `num_lines: optional number`
+
+ - `start_line: optional number`
+
+ - `total_lines: optional number`
+
+### Thinking Block
+
+- `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+### Thinking Block Param
+
+- `thinking_block_param: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+### Thinking Config Adaptive
+
+- `thinking_config_adaptive: object { type, display }`
+
+ - `type: "adaptive"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Thinking Config Disabled
+
+- `thinking_config_disabled: object { type }`
+
+ - `type: "disabled"`
+
+### Thinking Config Enabled
+
+- `thinking_config_enabled: object { budget_tokens, type, display }`
+
+ - `budget_tokens: number`
+
+ Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
+
+ Must be ≥1024 and less than `max_tokens`.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `type: "enabled"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Thinking Config Param
+
+- `thinking_config_param: ThinkingConfigEnabled or ThinkingConfigDisabled or ThinkingConfigAdaptive`
+
+ Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `thinking_config_enabled: object { budget_tokens, type, display }`
+
+ - `budget_tokens: number`
+
+ Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
+
+ Must be ≥1024 and less than `max_tokens`.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+ - `type: "enabled"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+ - `thinking_config_disabled: object { type }`
+
+ - `type: "disabled"`
+
+ - `thinking_config_adaptive: object { type, display }`
+
+ - `type: "adaptive"`
+
+ - `display: optional "summarized" or "omitted"`
+
+ Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
+
+ - `"summarized"`
+
+ - `"omitted"`
+
+### Thinking Delta
+
+- `thinking_delta: object { thinking, type }`
+
+ - `thinking: string`
+
+ - `type: "thinking_delta"`
+
+### Tool
+
+- `tool: object { input_schema, name, allowed_callers, 7 more }`
+
+ - `input_schema: object { type, properties, required }`
+
+ [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
+
+ This defines the shape of the `input` that your tool accepts and that the model will produce.
+
+ - `type: "object"`
+
+ - `properties: optional map[unknown]`
+
+ - `required: optional array of string`
+
+ - `name: string`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `description: optional string`
+
+ Description of what this tool does.
+
+ Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
+
+ - `eager_input_streaming: optional boolean`
+
+ Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `type: optional "custom"`
+
+ - `"custom"`
+
+### Tool Bash 20250124
+
+- `tool_bash_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Tool Choice
+
+- `tool_choice: ToolChoiceAuto or ToolChoiceAny or ToolChoiceTool or ToolChoiceNone`
+
+ How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+ - `tool_choice_auto: object { type, disable_parallel_tool_use }`
+
+ The model will automatically decide whether to use tools.
+
+ - `type: "auto"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output at most one tool use.
+
+ - `tool_choice_any: object { type, disable_parallel_tool_use }`
+
+ The model will use any available tools.
+
+ - `type: "any"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+ - `tool_choice_tool: object { name, type, disable_parallel_tool_use }`
+
+ The model will use the specified tool with `tool_choice.name`.
+
+ - `name: string`
+
+ The name of the tool to use.
+
+ - `type: "tool"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+ - `tool_choice_none: object { type }`
+
+ The model will not be allowed to use tools.
+
+ - `type: "none"`
+
+### Tool Choice Any
+
+- `tool_choice_any: object { type, disable_parallel_tool_use }`
+
+ The model will use any available tools.
+
+ - `type: "any"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+### Tool Choice Auto
+
+- `tool_choice_auto: object { type, disable_parallel_tool_use }`
+
+ The model will automatically decide whether to use tools.
+
+ - `type: "auto"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output at most one tool use.
+
+### Tool Choice None
+
+- `tool_choice_none: object { type }`
+
+ The model will not be allowed to use tools.
+
+ - `type: "none"`
+
+### Tool Choice Tool
+
+- `tool_choice_tool: object { name, type, disable_parallel_tool_use }`
+
+ The model will use the specified tool with `tool_choice.name`.
+
+ - `name: string`
+
+ The name of the tool to use.
+
+ - `type: "tool"`
+
+ - `disable_parallel_tool_use: optional boolean`
+
+ Whether to disable parallel tool use.
+
+ Defaults to `false`. If set to `true`, the model will output exactly one tool use.
+
+### Tool Reference Block
+
+- `tool_reference_block: object { tool_name, type }`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+### Tool Reference Block Param
+
+- `tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Tool Result Block Param
+
+- `tool_result_block_param: object { tool_use_id, type, cache_control, 2 more }`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `content: optional array of TextBlockParam or ImageBlockParam or SearchResultBlockParam or 2 more`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `search_result_block_param: object { content, source, title, 3 more }`
+
+ - `content: array of TextBlockParam`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `source: string`
+
+ - `title: string`
+
+ - `type: "search_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `document_block_param: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `tool_reference_block_param: object { tool_name, type, cache_control }`
+
+ Tool reference block that can be included in tool_result content.
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `is_error: optional boolean`
+
+### Tool Search Tool Bm25 20251119
+
+- `tool_search_tool_bm25_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_bm25"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
+
+ - `"tool_search_tool_bm25_20251119"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Tool Search Tool Regex 20251119
+
+- `tool_search_tool_regex_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_regex"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
+
+ - `"tool_search_tool_regex_20251119"`
+
+ - `"tool_search_tool_regex"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Tool Search Tool Result Block
+
+- `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+### Tool Search Tool Result Block Param
+
+- `tool_search_tool_result_block_param: object { content, tool_use_id, type, cache_control }`
+
+ - `content: ToolSearchToolResultErrorParam or ToolSearchToolSearchResultBlockParam`
+
+ - `tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+### Tool Search Tool Result Error
+
+- `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+### Tool Search Tool Result Error Code
+
+- `tool_search_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+### Tool Search Tool Result Error Param
+
+- `tool_search_tool_result_error_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "tool_search_tool_result_error"`
+
+### Tool Search Tool Search Result Block
+
+- `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+### Tool Search Tool Search Result Block Param
+
+- `tool_search_tool_search_result_block_param: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlockParam`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "tool_search_tool_search_result"`
+
+### Tool Text Editor 20250124
+
+- `tool_text_editor_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Tool Text Editor 20250429
+
+- `tool_text_editor_20250429: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250429"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Tool Text Editor 20250728
+
+- `tool_text_editor_20250728: object { name, type, allowed_callers, 5 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250728"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `max_characters: optional number`
+
+ Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Tool Union
+
+- `tool_union: Tool or ToolBash20250124 or CodeExecutionTool20250522 or 13 more`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `tool: object { input_schema, name, allowed_callers, 7 more }`
+
+ - `input_schema: object { type, properties, required }`
+
+ [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
+
+ This defines the shape of the `input` that your tool accepts and that the model will produce.
+
+ - `type: "object"`
+
+ - `properties: optional map[unknown]`
+
+ - `required: optional array of string`
+
+ - `name: string`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `description: optional string`
+
+ Description of what this tool does.
+
+ Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
+
+ - `eager_input_streaming: optional boolean`
+
+ Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `type: optional "custom"`
+
+ - `"custom"`
+
+ - `tool_bash_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "bash"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "bash_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `code_execution_tool_20250522: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250522"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `code_execution_tool_20250825: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20250825"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `code_execution_tool_20260120: object { name, type, allowed_callers, 3 more }`
+
+ Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
+
+ - `name: "code_execution"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "code_execution_20260120"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `memory_tool_20250818: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "memory"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "memory_20250818"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `tool_text_editor_20250124: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_editor"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250124"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `tool_text_editor_20250429: object { name, type, allowed_callers, 4 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250429"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `tool_text_editor_20250728: object { name, type, allowed_callers, 5 more }`
+
+ - `name: "str_replace_based_edit_tool"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "text_editor_20250728"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `input_examples: optional array of map[unknown]`
+
+ - `max_characters: optional number`
+
+ Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `web_search_tool_20250305: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20250305"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+ - `web_fetch_tool_20250910: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20250910"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `web_search_tool_20260209: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+ - `web_fetch_tool_20260209: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `web_fetch_tool_20260309: object { name, type, allowed_callers, 9 more }`
+
+ Web fetch tool with use_cache parameter for bypassing cached content.
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260309"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `use_cache: optional boolean`
+
+ Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
+
+ - `tool_search_tool_bm25_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_bm25"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_bm25_20251119" or "tool_search_tool_bm25"`
+
+ - `"tool_search_tool_bm25_20251119"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `tool_search_tool_regex_20251119: object { name, type, allowed_callers, 3 more }`
+
+ - `name: "tool_search_tool_regex"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "tool_search_tool_regex_20251119" or "tool_search_tool_regex"`
+
+ - `"tool_search_tool_regex_20251119"`
+
+ - `"tool_search_tool_regex"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Tool Use Block
+
+- `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+### Tool Use Block Param
+
+- `tool_use_block_param: object { id, input, name, 3 more }`
+
+ - `id: string`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### URL Image Source
+
+- `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+### URL PDF Source
+
+- `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+### Usage
+
+- `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+### User Location
+
+- `user_location: object { type, city, country, 2 more }`
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Web Fetch Block
+
+- `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+### Web Fetch Block Param
+
+- `web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+### Web Fetch Tool 20250910
+
+- `web_fetch_tool_20250910: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20250910"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Web Fetch Tool 20260209
+
+- `web_fetch_tool_20260209: object { name, type, allowed_callers, 8 more }`
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+### Web Fetch Tool 20260309
+
+- `web_fetch_tool_20260309: object { name, type, allowed_callers, 9 more }`
+
+ Web fetch tool with use_cache parameter for bypassing cached content.
+
+ - `name: "web_fetch"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_fetch_20260309"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ List of domains to allow fetching from
+
+ - `blocked_domains: optional array of string`
+
+ List of domains to block fetching from
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ Citations configuration for fetched documents. Citations are disabled by default.
+
+ - `enabled: optional boolean`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_content_tokens: optional number`
+
+ Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `use_cache: optional boolean`
+
+ Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
+
+### Web Fetch Tool Result Block
+
+- `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+### Web Fetch Tool Result Block Param
+
+- `web_fetch_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: WebFetchToolResultErrorBlockParam or WebFetchBlockParam`
+
+ - `web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block_param: object { content, type, url, retrieved_at }`
+
+ - `content: object { source, type, cache_control, 3 more }`
+
+ - `source: Base64PDFSource or PlainTextSource or ContentBlockSource or URLPDFSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `content_block_source: object { content, type }`
+
+ - `content: string or array of ContentBlockSourceContent`
+
+ - `union_member_0: string`
+
+ - `content_block_source_content: array of ContentBlockSourceContent`
+
+ - `text_block_param: object { text, type, cache_control, citations }`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional array of TextCitationParam`
+
+ - `citation_char_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location_param: object { cited_text, document_index, document_title, 3 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citation_web_search_result_location_param: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citation_search_result_location_param: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `image_block_param: object { source, type, cache_control }`
+
+ - `source: Base64ImageSource or URLImageSource`
+
+ - `base64_image_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
+
+ - `"image/jpeg"`
+
+ - `"image/png"`
+
+ - `"image/gif"`
+
+ - `"image/webp"`
+
+ - `type: "base64"`
+
+ - `url_image_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "image"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `type: "content"`
+
+ - `url_pdf_source: object { type, url }`
+
+ - `type: "url"`
+
+ - `url: string`
+
+ - `type: "document"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `citations: optional object { enabled }`
+
+ - `enabled: optional boolean`
+
+ - `context: optional string`
+
+ - `title: optional string`
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `retrieved_at: optional string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Web Fetch Tool Result Error Block
+
+- `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+### Web Fetch Tool Result Error Block Param
+
+- `web_fetch_tool_result_error_block_param: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+### Web Fetch Tool Result Error Code
+
+- `web_fetch_tool_result_error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+### Web Search Result Block
+
+- `web_search_result_block: object { encrypted_content, page_age, title, 2 more }`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+### Web Search Result Block Param
+
+- `web_search_result_block_param: object { encrypted_content, title, type, 2 more }`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+### Web Search Tool 20250305
+
+- `web_search_tool_20250305: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20250305"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Web Search Tool 20260209
+
+- `web_search_tool_20260209: object { name, type, allowed_callers, 7 more }`
+
+ - `name: "web_search"`
+
+ Name of the tool.
+
+ This is how the tool will be called by the model and in `tool_use` blocks.
+
+ - `type: "web_search_20260209"`
+
+ - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120"`
+
+ - `"direct"`
+
+ - `"code_execution_20250825"`
+
+ - `"code_execution_20260120"`
+
+ - `allowed_domains: optional array of string`
+
+ If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.
+
+ - `blocked_domains: optional array of string`
+
+ If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `defer_loading: optional boolean`
+
+ If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
+
+ - `max_uses: optional number`
+
+ Maximum number of times the tool can be used in the API request.
+
+ - `strict: optional boolean`
+
+ When true, guarantees schema validation on tool names and inputs
+
+ - `user_location: optional object { type, city, country, 2 more }`
+
+ Parameters for the user's location. Used to provide more relevant search results.
+
+ - `type: "approximate"`
+
+ - `city: optional string`
+
+ The city of the user.
+
+ - `country: optional string`
+
+ The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
+
+ - `region: optional string`
+
+ The region of the user.
+
+ - `timezone: optional string`
+
+ The [IANA timezone](https://nodatime.org/TimeZones) of the user.
+
+### Web Search Tool Request Error
+
+- `web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Web Search Tool Result Block
+
+- `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+### Web Search Tool Result Block Content
+
+- `web_search_tool_result_block_content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+### Web Search Tool Result Block Param
+
+- `web_search_tool_result_block_param: object { content, tool_use_id, type, 2 more }`
+
+ - `content: array of WebSearchResultBlockParam or WebSearchToolRequestError`
+
+ - `web_search_tool_result_block_item: array of WebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `cache_control: optional object { type, ttl }`
+
+ Create a cache control breakpoint at this content block.
+
+ - `type: "ephemeral"`
+
+ - `ttl: optional "5m" or "1h"`
+
+ The time-to-live for the cache control breakpoint.
+
+ This may be one the following values:
+
+ - `5m`: 5 minutes
+ - `1h`: 1 hour
+
+ Defaults to `5m`.
+
+ - `"5m"`
+
+ - `"1h"`
+
+ - `caller: optional DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+### Web Search Tool Result Block Param Content
+
+- `web_search_tool_result_block_param_content: array of WebSearchResultBlockParam or WebSearchToolRequestError`
+
+ - `web_search_tool_result_block_item: array of WebSearchResultBlockParam`
+
+ - `encrypted_content: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `page_age: optional string`
+
+ - `web_search_tool_request_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Web Search Tool Result Error
+
+- `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+### Web Search Tool Result Error Code
+
+- `web_search_tool_result_error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+# Batches
+
+## Create
+
+`$ ant messages:batches create`
+
+**post** `/v1/messages/batches`
+
+Send a batch of Message creation requests.
+
+The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--request: array of object { custom_id, params }`
+
+ List of requests for prompt completion. Each is an individual request to create a Message.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches create \
+ --api-key my-anthropic-api-key \
+ --request '{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text}], role: user}], model: claude-opus-4-6}}'
+```
+
+## Retrieve
+
+`$ ant messages:batches retrieve`
+
+**get** `/v1/messages/batches/{message_batch_id}`
+
+This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches retrieve \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## List
+
+`$ ant messages:batches list`
+
+**get** `/v1/messages/batches`
+
+List all Message Batches within a Workspace. Most recently created batches are returned first.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--after-id: optional string`
+
+ ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+### Returns
+
+- `ListResponse_MessageBatch_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of MessageBatch`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant messages:batches list \
+ --api-key my-anthropic-api-key
+```
+
+## Cancel
+
+`$ ant messages:batches cancel`
+
+**post** `/v1/messages/batches/{message_batch_id}/cancel`
+
+Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
+
+The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches cancel \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Delete
+
+`$ ant messages:batches delete`
+
+**delete** `/v1/messages/batches/{message_batch_id}`
+
+Delete a Message Batch.
+
+Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Example
+
+```cli
+ant messages:batches delete \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Results
+
+`$ ant messages:batches results`
+
+**get** `/v1/messages/batches/{message_batch_id}/results`
+
+Streams the results of a Message Batch as a `.jsonl` file.
+
+Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
+
+ - `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Example
+
+```cli
+ant messages:batches results \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Domain Types
+
+### Deleted Message Batch
+
+- `deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Message Batch
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Message Batch Canceled Result
+
+- `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+### Message Batch Errored Result
+
+- `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+### Message Batch Expired Result
+
+- `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Message Batch Individual Response
+
+- `message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
+
+ - `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Message Batch Request Counts
+
+- `message_batch_request_counts: object { canceled, errored, expired, 2 more }`
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+### Message Batch Result
+
+- `message_batch_result: MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
+
+ - `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Message Batch Succeeded Result
+
+- `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
diff --git a/content/en/api/cli/messages/batches.md b/content/en/api/cli/messages/batches.md
index 5d627650b..b17075cf4 100644
--- a/content/en/api/cli/messages/batches.md
+++ b/content/en/api/cli/messages/batches.md
@@ -1 +1,4250 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Batches
+
+## Create
+
+`$ ant messages:batches create`
+
+**post** `/v1/messages/batches`
+
+Send a batch of Message creation requests.
+
+The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--request: array of object { custom_id, params }`
+
+ List of requests for prompt completion. Each is an individual request to create a Message.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches create \
+ --api-key my-anthropic-api-key \
+ --request '{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text}], role: user}], model: claude-opus-4-6}}'
+```
+
+## Retrieve
+
+`$ ant messages:batches retrieve`
+
+**get** `/v1/messages/batches/{message_batch_id}`
+
+This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches retrieve \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## List
+
+`$ ant messages:batches list`
+
+**get** `/v1/messages/batches`
+
+List all Message Batches within a Workspace. Most recently created batches are returned first.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--after-id: optional string`
+
+ ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+### Returns
+
+- `ListResponse_MessageBatch_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of MessageBatch`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant messages:batches list \
+ --api-key my-anthropic-api-key
+```
+
+## Cancel
+
+`$ ant messages:batches cancel`
+
+**post** `/v1/messages/batches/{message_batch_id}/cancel`
+
+Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
+
+The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches cancel \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Delete
+
+`$ ant messages:batches delete`
+
+**delete** `/v1/messages/batches/{message_batch_id}`
+
+Delete a Message Batch.
+
+Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Example
+
+```cli
+ant messages:batches delete \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Results
+
+`$ ant messages:batches results`
+
+**get** `/v1/messages/batches/{message_batch_id}/results`
+
+Streams the results of a Message Batch as a `.jsonl` file.
+
+Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
+
+ - `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Example
+
+```cli
+ant messages:batches results \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
+
+## Domain Types
+
+### Deleted Message Batch
+
+- `deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Message Batch
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Message Batch Canceled Result
+
+- `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+### Message Batch Errored Result
+
+- `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+### Message Batch Expired Result
+
+- `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Message Batch Individual Response
+
+- `message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
+
+ - `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Message Batch Request Counts
+
+- `message_batch_request_counts: object { canceled, errored, expired, 2 more }`
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+### Message Batch Result
+
+- `message_batch_result: MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
+
+ - `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Message Batch Succeeded Result
+
+- `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
diff --git a/content/en/api/cli/messages/batches/cancel.md b/content/en/api/cli/messages/batches/cancel.md
index 81a0014ec..250cfedea 100644
--- a/content/en/api/cli/messages/batches/cancel.md
+++ b/content/en/api/cli/messages/batches/cancel.md
@@ -1 +1,113 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Cancel
+
+`$ ant messages:batches cancel`
+
+**post** `/v1/messages/batches/{message_batch_id}/cancel`
+
+Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
+
+The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches cancel \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
diff --git a/content/en/api/cli/messages/batches/create.md b/content/en/api/cli/messages/batches/create.md
index 9425d5356..34d8becb7 100644
--- a/content/en/api/cli/messages/batches/create.md
+++ b/content/en/api/cli/messages/batches/create.md
@@ -1 +1,113 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Create
+
+`$ ant messages:batches create`
+
+**post** `/v1/messages/batches`
+
+Send a batch of Message creation requests.
+
+The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--request: array of object { custom_id, params }`
+
+ List of requests for prompt completion. Each is an individual request to create a Message.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches create \
+ --api-key my-anthropic-api-key \
+ --request '{custom_id: my-custom-id-1, params: {max_tokens: 1024, messages: [{content: [{text: x, type: text}], role: user}], model: claude-opus-4-6}}'
+```
diff --git a/content/en/api/cli/messages/batches/delete.md b/content/en/api/cli/messages/batches/delete.md
index 92909acc6..23d487a8e 100644
--- a/content/en/api/cli/messages/batches/delete.md
+++ b/content/en/api/cli/messages/batches/delete.md
@@ -1 +1,39 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Delete
+
+`$ ant messages:batches delete`
+
+**delete** `/v1/messages/batches/{message_batch_id}`
+
+Delete a Message Batch.
+
+Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `deleted_message_batch: object { id, type }`
+
+ - `id: string`
+
+ ID of the Message Batch.
+
+ - `type: "message_batch_deleted"`
+
+ Deleted object type.
+
+ For Message Batches, this is always `"message_batch_deleted"`.
+
+### Example
+
+```cli
+ant messages:batches delete \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
diff --git a/content/en/api/cli/messages/batches/list.md b/content/en/api/cli/messages/batches/list.md
index f52ea9152..5b26ceb4b 100644
--- a/content/en/api/cli/messages/batches/list.md
+++ b/content/en/api/cli/messages/batches/list.md
@@ -1 +1,134 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## List
+
+`$ ant messages:batches list`
+
+**get** `/v1/messages/batches`
+
+List all Message Batches within a Workspace. Most recently created batches are returned first.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--after-id: optional string`
+
+ ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+### Returns
+
+- `ListResponse_MessageBatch_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of MessageBatch`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant messages:batches list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/messages/batches/results.md b/content/en/api/cli/messages/batches/results.md
index d45d10752..7f1dde6c6 100644
--- a/content/en/api/cli/messages/batches/results.md
+++ b/content/en/api/cli/messages/batches/results.md
@@ -1 +1,923 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Results
+
+`$ ant messages:batches results`
+
+**get** `/v1/messages/batches/{message_batch_id}/results`
+
+Streams the results of a Message Batch as a `.jsonl` file.
+
+Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch_individual_response: object { custom_id, result }`
+
+ This is a single line in the response `.jsonl` file and does not represent the response as a whole.
+
+ - `custom_id: string`
+
+ Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
+
+ Must be unique for each request within the Message Batch.
+
+ - `result: MessageBatchSucceededResult or MessageBatchErroredResult or MessageBatchCanceledResult or MessageBatchExpiredResult`
+
+ Processing result for this request.
+
+ Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
+
+ - `message_batch_succeeded_result: object { message, type }`
+
+ - `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+ - `type: "succeeded"`
+
+ - `message_batch_errored_result: object { error, type }`
+
+ - `error: object { error, request_id, type }`
+
+ - `error: InvalidRequestError or AuthenticationError or BillingError or 6 more`
+
+ - `invalid_request_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "invalid_request_error"`
+
+ - `authentication_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "authentication_error"`
+
+ - `billing_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "billing_error"`
+
+ - `permission_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "permission_error"`
+
+ - `not_found_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "not_found_error"`
+
+ - `rate_limit_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "rate_limit_error"`
+
+ - `gateway_timeout_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "timeout_error"`
+
+ - `api_error_object: object { message, type }`
+
+ - `message: string`
+
+ - `type: "api_error"`
+
+ - `overloaded_error: object { message, type }`
+
+ - `message: string`
+
+ - `type: "overloaded_error"`
+
+ - `request_id: string`
+
+ - `type: "error"`
+
+ - `type: "errored"`
+
+ - `message_batch_canceled_result: object { type }`
+
+ - `type: "canceled"`
+
+ - `message_batch_expired_result: object { type }`
+
+ - `type: "expired"`
+
+### Example
+
+```cli
+ant messages:batches results \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
diff --git a/content/en/api/cli/messages/batches/retrieve.md b/content/en/api/cli/messages/batches/retrieve.md
index 6fce047c0..70b060159 100644
--- a/content/en/api/cli/messages/batches/retrieve.md
+++ b/content/en/api/cli/messages/batches/retrieve.md
@@ -1 +1,111 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Retrieve
+
+`$ ant messages:batches retrieve`
+
+**get** `/v1/messages/batches/{message_batch_id}`
+
+This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
+
+Learn more about the Message Batches API in our [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
+
+### Parameters
+
+- `--message-batch-id: string`
+
+ ID of the Message Batch.
+
+### Returns
+
+- `message_batch: object { id, archived_at, cancel_initiated_at, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `archived_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
+
+ - `cancel_initiated_at: string`
+
+ RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch was created.
+
+ - `ended_at: string`
+
+ RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
+
+ Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
+
+ - `expires_at: string`
+
+ RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
+
+ - `processing_status: "in_progress" or "canceling" or "ended"`
+
+ Processing status of the Message Batch.
+
+ - `"in_progress"`
+
+ - `"canceling"`
+
+ - `"ended"`
+
+ - `request_counts: object { canceled, errored, expired, 2 more }`
+
+ Tallies requests within the Message Batch, categorized by their status.
+
+ Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
+
+ - `canceled: number`
+
+ Number of requests in the Message Batch that have been canceled.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `errored: number`
+
+ Number of requests in the Message Batch that encountered an error.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `expired: number`
+
+ Number of requests in the Message Batch that have expired.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `processing: number`
+
+ Number of requests in the Message Batch that are processing.
+
+ - `succeeded: number`
+
+ Number of requests in the Message Batch that have completed successfully.
+
+ This is zero until processing of the entire Message Batch has ended.
+
+ - `results_url: string`
+
+ URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
+
+ Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
+
+ - `type: "message_batch"`
+
+ Object type.
+
+ For Message Batches, this is always `"message_batch"`.
+
+### Example
+
+```cli
+ant messages:batches retrieve \
+ --api-key my-anthropic-api-key \
+ --message-batch-id message_batch_id
+```
diff --git a/content/en/api/cli/messages/count_tokens.md b/content/en/api/cli/messages/count_tokens.md
index ba5e1ff0c..261ea3f8a 100644
--- a/content/en/api/cli/messages/count_tokens.md
+++ b/content/en/api/cli/messages/count_tokens.md
@@ -1 +1,177 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Count Tokens
+
+`$ ant messages count-tokens`
+
+**post** `/v1/messages/count_tokens`
+
+Count the number of tokens in a Message.
+
+The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.
+
+Learn more about token counting in our [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
+
+### Parameters
+
+- `--message: array of MessageParam`
+
+ Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--output-config: optional object { effort, format }`
+
+ Configuration options for the model's output, such as the output format.
+
+- `--system: optional string or array of TextBlockParam`
+
+ System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--thinking: optional ThinkingConfigEnabled or ThinkingConfigDisabled or ThinkingConfigAdaptive`
+
+ Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional ToolChoiceAuto or ToolChoiceAny or ToolChoiceTool or ToolChoiceNone`
+
+ How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of MessageCountTokensTool`
+
+ Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+### Returns
+
+- `message_tokens_count: object { input_tokens }`
+
+ - `input_tokens: number`
+
+ The total number of tokens across the provided list of messages, system prompt, and tools.
+
+### Example
+
+```cli
+ant messages count-tokens \
+ --api-key my-anthropic-api-key \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-mythos-preview
+```
diff --git a/content/en/api/cli/messages/create.md b/content/en/api/cli/messages/create.md
index 0bbbc48e2..251bc4a5e 100644
--- a/content/en/api/cli/messages/create.md
+++ b/content/en/api/cli/messages/create.md
@@ -1 +1,1032 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Create
+
+`$ ant messages create`
+
+**post** `/v1/messages`
+
+Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
+
+The Messages API can be used for either single queries or stateless multi-turn conversations.
+
+Learn more about the Messages API in our [user guide](https://docs.claude.com/en/docs/initial-setup)
+
+### Parameters
+
+- `--max-tokens: number`
+
+ The maximum number of tokens to generate before stopping.
+
+ Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
+
+ Different models have different maximum values for this parameter. See [models](https://docs.claude.com/en/docs/models-overview) for details.
+
+- `--message: array of MessageParam`
+
+ Input messages.
+
+ Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
+
+ Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
+
+ If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
+
+ Example with a single `user` message:
+
+ ```json
+ [{"role": "user", "content": "Hello, Claude"}]
+ ```
+
+ Example with multiple conversational turns:
+
+ ```json
+ [
+ {"role": "user", "content": "Hello there."},
+ {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
+ {"role": "user", "content": "Can you explain LLMs in plain English?"},
+ ]
+ ```
+
+ Example with a partially-filled response from Claude:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("},
+ ]
+ ```
+
+ Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
+
+ ```json
+ {"role": "user", "content": "Hello, Claude"}
+ ```
+
+ ```json
+ {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
+ ```
+
+ See [input examples](https://docs.claude.com/en/api/messages-examples).
+
+ Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
+
+ There is a limit of 100,000 messages in a single request.
+
+- `--model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+- `--cache-control: optional object { type, ttl }`
+
+ Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
+
+- `--container: optional string`
+
+ Container identifier for reuse across requests.
+
+- `--inference-geo: optional string`
+
+ Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.
+
+- `--metadata: optional object { user_id }`
+
+ An object describing metadata about the request.
+
+- `--output-config: optional object { effort, format }`
+
+ Configuration options for the model's output, such as the output format.
+
+- `--service-tier: optional "auto" or "standard_only"`
+
+ Determines whether to use priority capacity (if available) or standard capacity for this request.
+
+ Anthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
+
+- `--stop-sequence: optional array of string`
+
+ Custom text sequences that will cause the model to stop generating.
+
+ Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.
+
+ If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.
+
+- `--system: optional string or array of TextBlockParam`
+
+ System prompt.
+
+ A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
+
+- `--temperature: optional number`
+
+ Amount of randomness injected into the response.
+
+ Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
+
+ Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
+
+- `--thinking: optional ThinkingConfigEnabled or ThinkingConfigDisabled or ThinkingConfigAdaptive`
+
+ Configuration for enabling Claude's extended thinking.
+
+ When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.
+
+ See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details.
+
+- `--tool-choice: optional ToolChoiceAuto or ToolChoiceAny or ToolChoiceTool or ToolChoiceNone`
+
+ How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
+
+- `--tool: optional array of ToolUnion`
+
+ Definitions of tools that the model may use.
+
+ If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.
+
+ There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
+
+ Each tool definition includes:
+
+ * `name`: Name of the tool.
+ * `description`: Optional, but strongly-recommended description of the tool.
+ * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.
+
+ For example, if you defined `tools` as:
+
+ ```json
+ [
+ {
+ "name": "get_stock_price",
+ "description": "Get the current stock price for a given ticker symbol.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "ticker": {
+ "type": "string",
+ "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
+ }
+ },
+ "required": ["ticker"]
+ }
+ }
+ ]
+ ```
+
+ And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:
+
+ ```json
+ [
+ {
+ "type": "tool_use",
+ "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "name": "get_stock_price",
+ "input": { "ticker": "^GSPC" }
+ }
+ ]
+ ```
+
+ You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:
+
+ ```json
+ [
+ {
+ "type": "tool_result",
+ "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
+ "content": "259.75 USD"
+ }
+ ]
+ ```
+
+ Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.
+
+ See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
+
+- `--top-k: optional number`
+
+ Only sample from the top K options for each subsequent token.
+
+ Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+- `--top-p: optional number`
+
+ Use nucleus sampling.
+
+ In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.
+
+ Recommended for advanced use cases only. You usually only need to use `temperature`.
+
+### Returns
+
+- `message: object { id, container, content, 7 more }`
+
+ - `id: string`
+
+ Unique object identifier.
+
+ The format and length of IDs may change over time.
+
+ - `container: object { id, expires_at }`
+
+ Information about the container used in the request (for the code execution tool)
+
+ - `id: string`
+
+ Identifier for the container used in this request
+
+ - `expires_at: string`
+
+ The time at which the container will expire.
+
+ - `content: array of ContentBlock`
+
+ Content generated by the model.
+
+ This is an array of content blocks, each of which has a `type` that determines its shape.
+
+ Example:
+
+ ```json
+ [{"type": "text", "text": "Hi, I'm Claude."}]
+ ```
+
+ If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
+
+ For example, if the input `messages` were:
+
+ ```json
+ [
+ {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
+ {"role": "assistant", "content": "The best answer is ("}
+ ]
+ ```
+
+ Then the response `content` might be:
+
+ ```json
+ [{"type": "text", "text": "B)"}]
+ ```
+
+ - `text_block: object { citations, text, type }`
+
+ - `citations: array of TextCitation`
+
+ Citations supporting the text block.
+
+ The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
+
+ - `citation_char_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_char_index: number`
+
+ - `file_id: string`
+
+ - `start_char_index: number`
+
+ - `type: "char_location"`
+
+ - `citation_page_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_page_number: number`
+
+ - `file_id: string`
+
+ - `start_page_number: number`
+
+ - `type: "page_location"`
+
+ - `citation_content_block_location: object { cited_text, document_index, document_title, 4 more }`
+
+ - `cited_text: string`
+
+ - `document_index: number`
+
+ - `document_title: string`
+
+ - `end_block_index: number`
+
+ - `file_id: string`
+
+ - `start_block_index: number`
+
+ - `type: "content_block_location"`
+
+ - `citations_web_search_result_location: object { cited_text, encrypted_index, title, 2 more }`
+
+ - `cited_text: string`
+
+ - `encrypted_index: string`
+
+ - `title: string`
+
+ - `type: "web_search_result_location"`
+
+ - `url: string`
+
+ - `citations_search_result_location: object { cited_text, end_block_index, search_result_index, 4 more }`
+
+ - `cited_text: string`
+
+ - `end_block_index: number`
+
+ - `search_result_index: number`
+
+ - `source: string`
+
+ - `start_block_index: number`
+
+ - `title: string`
+
+ - `type: "search_result_location"`
+
+ - `text: string`
+
+ - `type: "text"`
+
+ - `thinking_block: object { signature, thinking, type }`
+
+ - `signature: string`
+
+ - `thinking: string`
+
+ - `type: "thinking"`
+
+ - `redacted_thinking_block: object { data, type }`
+
+ - `data: string`
+
+ - `type: "redacted_thinking"`
+
+ - `tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: string`
+
+ - `type: "tool_use"`
+
+ - `server_tool_use_block: object { id, caller, input, 2 more }`
+
+ - `id: string`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `input: map[unknown]`
+
+ - `name: "web_search" or "web_fetch" or "code_execution" or 4 more`
+
+ - `"web_search"`
+
+ - `"web_fetch"`
+
+ - `"code_execution"`
+
+ - `"bash_code_execution"`
+
+ - `"text_editor_code_execution"`
+
+ - `"tool_search_tool_regex"`
+
+ - `"tool_search_tool_bm25"`
+
+ - `type: "server_tool_use"`
+
+ - `web_search_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebSearchToolResultError or array of WebSearchResultBlock`
+
+ - `web_search_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"max_uses_exceeded"`
+
+ - `"too_many_requests"`
+
+ - `"query_too_long"`
+
+ - `"request_too_large"`
+
+ - `type: "web_search_tool_result_error"`
+
+ - `union_member_1: array of WebSearchResultBlock`
+
+ - `encrypted_content: string`
+
+ - `page_age: string`
+
+ - `title: string`
+
+ - `type: "web_search_result"`
+
+ - `url: string`
+
+ - `tool_use_id: string`
+
+ - `type: "web_search_tool_result"`
+
+ - `web_fetch_tool_result_block: object { caller, content, tool_use_id, type }`
+
+ - `caller: DirectCaller or ServerToolCaller or ServerToolCaller20260120`
+
+ Tool invocation directly from the model.
+
+ - `direct_caller: object { type }`
+
+ Tool invocation directly from the model.
+
+ - `type: "direct"`
+
+ - `server_tool_caller: object { tool_id, type }`
+
+ Tool invocation generated by a server-side tool.
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20250825"`
+
+ - `server_tool_caller_20260120: object { tool_id, type }`
+
+ - `tool_id: string`
+
+ - `type: "code_execution_20260120"`
+
+ - `content: WebFetchToolResultErrorBlock or WebFetchBlock`
+
+ - `web_fetch_tool_result_error_block: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 5 more`
+
+ - `"invalid_tool_input"`
+
+ - `"url_too_long"`
+
+ - `"url_not_allowed"`
+
+ - `"url_not_accessible"`
+
+ - `"unsupported_content_type"`
+
+ - `"too_many_requests"`
+
+ - `"max_uses_exceeded"`
+
+ - `"unavailable"`
+
+ - `type: "web_fetch_tool_result_error"`
+
+ - `web_fetch_block: object { content, retrieved_at, type, url }`
+
+ - `content: object { citations, source, title, type }`
+
+ - `citations: object { enabled }`
+
+ Citation configuration for the document
+
+ - `enabled: boolean`
+
+ - `source: Base64PDFSource or PlainTextSource`
+
+ - `base64_pdf_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "application/pdf"`
+
+ - `type: "base64"`
+
+ - `plain_text_source: object { data, media_type, type }`
+
+ - `data: string`
+
+ - `media_type: "text/plain"`
+
+ - `type: "text"`
+
+ - `title: string`
+
+ The title of the document
+
+ - `type: "document"`
+
+ - `retrieved_at: string`
+
+ ISO 8601 timestamp when the content was retrieved
+
+ - `type: "web_fetch_result"`
+
+ - `url: string`
+
+ Fetched content URL
+
+ - `tool_use_id: string`
+
+ - `type: "web_fetch_tool_result"`
+
+ - `code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: CodeExecutionToolResultError or CodeExecutionResultBlock or EncryptedCodeExecutionResultBlock`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `type: "code_execution_tool_result_error"`
+
+ - `code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "code_execution_result"`
+
+ - `encrypted_code_execution_result_block: object { content, encrypted_stdout, return_code, 2 more }`
+
+ Code execution result with encrypted stdout for PFC + web_search results.
+
+ - `content: array of CodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "code_execution_output"`
+
+ - `encrypted_stdout: string`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `type: "encrypted_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "code_execution_tool_result"`
+
+ - `bash_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: BashCodeExecutionToolResultError or BashCodeExecutionResultBlock`
+
+ - `bash_code_execution_tool_result_error: object { error_code, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"output_file_too_large"`
+
+ - `type: "bash_code_execution_tool_result_error"`
+
+ - `bash_code_execution_result_block: object { content, return_code, stderr, 2 more }`
+
+ - `content: array of BashCodeExecutionOutputBlock`
+
+ - `file_id: string`
+
+ - `type: "bash_code_execution_output"`
+
+ - `return_code: number`
+
+ - `stderr: string`
+
+ - `stdout: string`
+
+ - `type: "bash_code_execution_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "bash_code_execution_tool_result"`
+
+ - `text_editor_code_execution_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: TextEditorCodeExecutionToolResultError or TextEditorCodeExecutionViewResultBlock or TextEditorCodeExecutionCreateResultBlock or TextEditorCodeExecutionStrReplaceResultBlock`
+
+ - `text_editor_code_execution_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `"file_not_found"`
+
+ - `error_message: string`
+
+ - `type: "text_editor_code_execution_tool_result_error"`
+
+ - `text_editor_code_execution_view_result_block: object { content, file_type, num_lines, 3 more }`
+
+ - `content: string`
+
+ - `file_type: "text" or "image" or "pdf"`
+
+ - `"text"`
+
+ - `"image"`
+
+ - `"pdf"`
+
+ - `num_lines: number`
+
+ - `start_line: number`
+
+ - `total_lines: number`
+
+ - `type: "text_editor_code_execution_view_result"`
+
+ - `text_editor_code_execution_create_result_block: object { is_file_update, type }`
+
+ - `is_file_update: boolean`
+
+ - `type: "text_editor_code_execution_create_result"`
+
+ - `text_editor_code_execution_str_replace_result_block: object { lines, new_lines, new_start, 3 more }`
+
+ - `lines: array of string`
+
+ - `new_lines: number`
+
+ - `new_start: number`
+
+ - `old_lines: number`
+
+ - `old_start: number`
+
+ - `type: "text_editor_code_execution_str_replace_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "text_editor_code_execution_tool_result"`
+
+ - `tool_search_tool_result_block: object { content, tool_use_id, type }`
+
+ - `content: ToolSearchToolResultError or ToolSearchToolSearchResultBlock`
+
+ - `tool_search_tool_result_error: object { error_code, error_message, type }`
+
+ - `error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"`
+
+ - `"invalid_tool_input"`
+
+ - `"unavailable"`
+
+ - `"too_many_requests"`
+
+ - `"execution_time_exceeded"`
+
+ - `error_message: string`
+
+ - `type: "tool_search_tool_result_error"`
+
+ - `tool_search_tool_search_result_block: object { tool_references, type }`
+
+ - `tool_references: array of ToolReferenceBlock`
+
+ - `tool_name: string`
+
+ - `type: "tool_reference"`
+
+ - `type: "tool_search_tool_search_result"`
+
+ - `tool_use_id: string`
+
+ - `type: "tool_search_tool_result"`
+
+ - `container_upload_block: object { file_id, type }`
+
+ Response model for a file uploaded to the container.
+
+ - `file_id: string`
+
+ - `type: "container_upload"`
+
+ - `model: "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more or string`
+
+ The model that will complete your prompt.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
+ - `"claude-opus-4-6"`
+
+ Frontier intelligence for long-running agents and coding
+
+ - `"claude-sonnet-4-6"`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"`
+
+ High-performance model for agents and coding
+
+ - `"claude-opus-4-1"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-1-20250805"`
+
+ Exceptional model for specialized complex tasks
+
+ - `"claude-opus-4-0"`
+
+ Powerful model for complex tasks
+
+ - `"claude-opus-4-20250514"`
+
+ Powerful model for complex tasks
+
+ - `"claude-sonnet-4-0"`
+
+ High-performance model with extended thinking
+
+ - `"claude-sonnet-4-20250514"`
+
+ High-performance model with extended thinking
+
+ - `"claude-3-haiku-20240307"`
+
+ Fast and cost-effective model
+
+ - `role: "assistant"`
+
+ Conversational role of the generated message.
+
+ This will always be `"assistant"`.
+
+ - `stop_details: object { category, explanation, type }`
+
+ Structured information about a refusal.
+
+ - `category: "cyber" or "bio"`
+
+ The policy category that triggered the refusal.
+
+ `null` when the refusal doesn't map to a named category.
+
+ - `"cyber"`
+
+ - `"bio"`
+
+ - `explanation: string`
+
+ Human-readable explanation of the refusal.
+
+ This text is not guaranteed to be stable. `null` when no explanation is available for the category.
+
+ - `type: "refusal"`
+
+ - `stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 3 more`
+
+ The reason that we stopped.
+
+ This may be one the following values:
+
+ * `"end_turn"`: the model reached a natural stopping point
+ * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
+ * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
+ * `"tool_use"`: the model invoked one or more tools
+ * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
+ * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
+
+ In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.
+
+ - `"end_turn"`
+
+ - `"max_tokens"`
+
+ - `"stop_sequence"`
+
+ - `"tool_use"`
+
+ - `"pause_turn"`
+
+ - `"refusal"`
+
+ - `stop_sequence: string`
+
+ Which custom stop sequence was generated, if any.
+
+ This value will be a non-null string if one of your custom stop sequences was generated.
+
+ - `type: "message"`
+
+ Object type.
+
+ For Messages, this is always `"message"`.
+
+ - `usage: object { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }`
+
+ Billing and rate-limit usage.
+
+ Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
+
+ Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.
+
+ For example, `output_tokens` will be non-zero, even for an empty string response from Claude.
+
+ Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.
+
+ - `cache_creation: object { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }`
+
+ Breakdown of cached tokens by TTL
+
+ - `ephemeral_1h_input_tokens: number`
+
+ The number of input tokens used to create the 1 hour cache entry.
+
+ - `ephemeral_5m_input_tokens: number`
+
+ The number of input tokens used to create the 5 minute cache entry.
+
+ - `cache_creation_input_tokens: number`
+
+ The number of input tokens used to create the cache entry.
+
+ - `cache_read_input_tokens: number`
+
+ The number of input tokens read from the cache.
+
+ - `inference_geo: string`
+
+ The geographic region where inference was performed for this request.
+
+ - `input_tokens: number`
+
+ The number of input tokens which were used.
+
+ - `output_tokens: number`
+
+ The number of output tokens which were used.
+
+ - `server_tool_use: object { web_fetch_requests, web_search_requests }`
+
+ The number of server tool requests.
+
+ - `web_fetch_requests: number`
+
+ The number of web fetch tool requests.
+
+ - `web_search_requests: number`
+
+ The number of web search tool requests.
+
+ - `service_tier: "standard" or "priority" or "batch"`
+
+ If the request used the priority, standard, or batch tier.
+
+ - `"standard"`
+
+ - `"priority"`
+
+ - `"batch"`
+
+### Example
+
+```cli
+ant messages create \
+ --api-key my-anthropic-api-key \
+ --max-tokens 1024 \
+ --message '{content: [{text: x, type: text}], role: user}' \
+ --model claude-opus-4-6
+```
diff --git a/content/en/api/cli/models.md b/content/en/api/cli/models.md
index 236260cd6..05eb18c53 100644
--- a/content/en/api/cli/models.md
+++ b/content/en/api/cli/models.md
@@ -1 +1,920 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+# Models
+
+## List
+
+`$ ant models list`
+
+**get** `/v1/models`
+
+List available models.
+
+The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `ListResponse_ModelInfo_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of ModelInfo`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant models list \
+ --api-key my-anthropic-api-key
+```
+
+## Retrieve
+
+`$ ant models retrieve`
+
+**get** `/v1/models/{model_id}`
+
+Get a specific model.
+
+The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
+
+### Parameters
+
+- `--model-id: string`
+
+ Model identifier or alias.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `model_info: object { id, capabilities, created_at, 4 more }`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+### Example
+
+```cli
+ant models retrieve \
+ --api-key my-anthropic-api-key \
+ --model-id model_id
+```
+
+## Domain Types
+
+### Capability Support
+
+- `capability_support: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Context Management Capability
+
+- `context_management_capability: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management capability details.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Effort Capability
+
+- `effort_capability: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) capability details.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Model Capabilities
+
+- `model_capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Model Info
+
+- `model_info: object { id, capabilities, created_at, 4 more }`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+### Thinking Capability
+
+- `thinking_capability: object { supported, types }`
+
+ Thinking capability details.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+### Thinking Types
+
+- `thinking_types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
diff --git a/content/en/api/cli/models/list.md b/content/en/api/cli/models/list.md
index d906e3717..957f9ebe6 100644
--- a/content/en/api/cli/models/list.md
+++ b/content/en/api/cli/models/list.md
@@ -1 +1,232 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## List
+
+`$ ant models list`
+
+**get** `/v1/models`
+
+List available models.
+
+The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
+
+### Parameters
+
+- `--after-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
+
+- `--before-id: optional string`
+
+ Query param: ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
+
+- `--limit: optional number`
+
+ Query param: Number of items to return per page.
+
+ Defaults to `20`. Ranges from `1` to `1000`.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `ListResponse_ModelInfo_: object { data, first_id, has_more, last_id }`
+
+ - `data: array of ModelInfo`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+ - `first_id: string`
+
+ First ID in the `data` list. Can be used as the `before_id` for the previous page.
+
+ - `has_more: boolean`
+
+ Indicates if there are more results in the requested page direction.
+
+ - `last_id: string`
+
+ Last ID in the `data` list. Can be used as the `after_id` for the next page.
+
+### Example
+
+```cli
+ant models list \
+ --api-key my-anthropic-api-key
+```
diff --git a/content/en/api/cli/models/retrieve.md b/content/en/api/cli/models/retrieve.md
index 4628c12f4..96fb501cd 100644
--- a/content/en/api/cli/models/retrieve.md
+++ b/content/en/api/cli/models/retrieve.md
@@ -1 +1,209 @@
-Not Found - Claude API Docs
Loading...
\ No newline at end of file
+## Retrieve
+
+`$ ant models retrieve`
+
+**get** `/v1/models/{model_id}`
+
+Get a specific model.
+
+The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
+
+### Parameters
+
+- `--model-id: string`
+
+ Model identifier or alias.
+
+- `--beta: optional array of AnthropicBeta`
+
+ Optional header to specify the beta version(s) you want to use.
+
+### Returns
+
+- `model_info: object { id, capabilities, created_at, 4 more }`
+
+ - `id: string`
+
+ Unique model identifier.
+
+ - `capabilities: object { batch, citations, code_execution, 6 more }`
+
+ Model capability information.
+
+ - `batch: object { supported }`
+
+ Whether the model supports the Batch API.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `citations: object { supported }`
+
+ Whether the model supports citation generation.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `code_execution: object { supported }`
+
+ Whether the model supports code execution tools.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `context_management: object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }`
+
+ Context management support and available strategies.
+
+ - `clear_thinking_20251015: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `clear_tool_uses_20250919: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `compact_20260112: object { supported }`
+
+ Indicates whether a capability is supported.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `effort: object { high, low, max, 2 more }`
+
+ Effort (reasoning_effort) support and available levels.
+
+ - `high: object { supported }`
+
+ Whether the model supports high effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `low: object { supported }`
+
+ Whether the model supports low effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `max: object { supported }`
+
+ Whether the model supports max effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `medium: object { supported }`
+
+ Whether the model supports medium effort level.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `image_input: object { supported }`
+
+ Whether the model accepts image content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `pdf_input: object { supported }`
+
+ Whether the model accepts PDF content blocks.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `structured_outputs: object { supported }`
+
+ Whether the model supports structured output / JSON mode / strict tool schemas.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `thinking: object { supported, types }`
+
+ Thinking capability and supported type configurations.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `types: object { adaptive, enabled }`
+
+ Supported thinking type configurations.
+
+ - `adaptive: object { supported }`
+
+ Whether the model supports thinking with type 'adaptive' (auto).
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `enabled: object { supported }`
+
+ Whether the model supports thinking with type 'enabled'.
+
+ - `supported: boolean`
+
+ Whether this capability is supported by the model.
+
+ - `created_at: string`
+
+ RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
+
+ - `display_name: string`
+
+ A human-readable name for the model.
+
+ - `max_input_tokens: number`
+
+ Maximum input context window size in tokens for this model.
+
+ - `max_tokens: number`
+
+ Maximum value for the `max_tokens` parameter when using this model.
+
+ - `type: "model"`
+
+ Object type.
+
+ For Models, this is always `"model"`.
+
+### Example
+
+```cli
+ant models retrieve \
+ --api-key my-anthropic-api-key \
+ --model-id model_id
+```
diff --git a/content/en/api/client-sdks.md b/content/en/api/client-sdks.md
index feb822927..29d6c609f 100644
--- a/content/en/api/client-sdks.md
+++ b/content/en/api/client-sdks.md
@@ -1,12 +1,15 @@
# Client SDKs
-Official SDKs for building with the Claude API in Python, TypeScript, Java, Go, Ruby, C#, and PHP.
+Official SDKs for building with the Claude API in Python, TypeScript, Java, Go, Ruby, C#, PHP, and the command line.
---
Anthropic provides official client SDKs in multiple languages to make it easier to work with the Claude API. Each SDK provides idiomatic interfaces, type safety, and built-in support for features like streaming, retries, and error handling.
+
+ Shell scripting, typed flags, response transforms
+
Sync and async clients, Pydantic models
@@ -33,6 +36,11 @@ Anthropic provides official client SDKs in multiple languages to make it easier
## Quick installation
+
+```bash
+brew install anthropics/tap/ant
+```
+
```bash
pip install anthropic
@@ -56,14 +64,14 @@ go get github.com/anthropics/anthropic-sdk-go
```groovy Gradle
-implementation("com.anthropic:anthropic-java:2.18.0")
+implementation("com.anthropic:anthropic-java:2.20.0")
```
```xml Maven
com.anthropicanthropic-java
- 2.18.0
+ 2.20.0
```
@@ -83,6 +91,14 @@ bundler add anthropic
## Quick start
+```bash CLI
+ant messages create \
+ --model claude-opus-4-6 \
+ --max-tokens 1024 \
+ --message '{role: user, content: "Hello, Claude"}' \
+ --transform content
+```
+
```python Python
import anthropic
@@ -224,6 +240,14 @@ Access beta features using the `beta` namespace in any SDK:
+```bash CLI nocheck
+ant beta:messages create \
+ --model claude-opus-4-6 \
+ --max-tokens 1024 \
+ --message '{role: user, content: "Hello"}' \
+ --beta feature-name
+```
+
```python Python nocheck
message = client.beta.messages.create(
model="claude-opus-4-6",
diff --git a/content/en/api/completions.md b/content/en/api/completions.md
index 25d48f90b..e530f7c9b 100644
--- a/content/en/api/completions.md
+++ b/content/en/api/completions.md
@@ -18,7 +18,7 @@ Future models and features will not be compatible with Text Completions. See our
- `UnionMember0 = string`
- - `UnionMember1 = "message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 19 more`
+ - `UnionMember1 = "message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 18 more`
- `"message-batches-2024-09-24"`
@@ -62,8 +62,6 @@ Future models and features will not be compatible with Text Completions. See our
- `"output-300k-2026-03-24"`
- - `"user-profiles-2026-03-24"`
-
### Body Parameters
- `max_tokens_to_sample: number`
@@ -78,15 +76,19 @@ Future models and features will not be compatible with Text Completions. See our
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- - `UnionMember0 = "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 12 more`
+ - `UnionMember0 = "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more`
The model that will complete your prompt.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"`
@@ -234,15 +236,19 @@ Future models and features will not be compatible with Text Completions. See our
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- - `UnionMember0 = "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 12 more`
+ - `UnionMember0 = "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more`
The model that will complete your prompt.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"`
@@ -329,7 +335,7 @@ curl https://api.anthropic.com/v1/complete \
--max-time 600 \
-d '{
"max_tokens_to_sample": 256,
- "model": "claude-opus-4-6",
+ "model": "claude-mythos-preview",
"prompt": "\\n\\nHuman: Hello, world!\\n\\nAssistant:"
}'
```
@@ -356,15 +362,19 @@ curl https://api.anthropic.com/v1/complete \
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- - `UnionMember0 = "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 12 more`
+ - `UnionMember0 = "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more`
The model that will complete your prompt.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"`
diff --git a/content/en/api/completions/create.md b/content/en/api/completions/create.md
index deee11be4..24383a675 100644
--- a/content/en/api/completions/create.md
+++ b/content/en/api/completions/create.md
@@ -16,7 +16,7 @@ Future models and features will not be compatible with Text Completions. See our
- `UnionMember0 = string`
- - `UnionMember1 = "message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 19 more`
+ - `UnionMember1 = "message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 18 more`
- `"message-batches-2024-09-24"`
@@ -60,8 +60,6 @@ Future models and features will not be compatible with Text Completions. See our
- `"output-300k-2026-03-24"`
- - `"user-profiles-2026-03-24"`
-
### Body Parameters
- `max_tokens_to_sample: number`
@@ -76,15 +74,19 @@ Future models and features will not be compatible with Text Completions. See our
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- - `UnionMember0 = "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 12 more`
+ - `UnionMember0 = "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more`
The model that will complete your prompt.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"`
@@ -232,15 +234,19 @@ Future models and features will not be compatible with Text Completions. See our
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- - `UnionMember0 = "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 12 more`
+ - `UnionMember0 = "claude-mythos-preview" or "claude-opus-4-6" or "claude-sonnet-4-6" or 13 more`
The model that will complete your prompt.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"`
@@ -327,7 +333,7 @@ curl https://api.anthropic.com/v1/complete \
--max-time 600 \
-d '{
"max_tokens_to_sample": 256,
- "model": "claude-opus-4-6",
+ "model": "claude-mythos-preview",
"prompt": "\\n\\nHuman: Hello, world!\\n\\nAssistant:"
}'
```
diff --git a/content/en/api/csharp/beta.md b/content/en/api/csharp/beta.md
index 8836ef4da..0633e2e19 100644
--- a/content/en/api/csharp/beta.md
+++ b/content/en/api/csharp/beta.md
@@ -272,8 +272,6 @@ The Models API response can be used to determine which models are available for
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class ModelListPageResponse:`
@@ -546,8 +544,6 @@ The Models API response can be used to determine information about a specific mo
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BetaModelInfo:`
@@ -5061,10 +5057,6 @@ Learn more about the Messages API in our [user guide](https://docs.claude.com/en
Recommended for advanced use cases only. You usually only need to use `temperature`.
- - `string? userProfileID`
-
- Body param: The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization.
-
- `IReadOnlyList betas`
Header param: Optional header to specify the beta version(s) you want to use.
@@ -5111,8 +5103,6 @@ Learn more about the Messages API in our [user guide](https://docs.claude.com/en
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BetaMessage:`
@@ -5908,9 +5898,13 @@ Learn more about the Messages API in our [user guide](https://docs.claude.com/en
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -10014,8 +10008,6 @@ Learn more about token counting in our [user guide](https://docs.claude.com/en/d
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BetaMessageTokensCount:`
@@ -10045,7 +10037,7 @@ MessageCountTokensParams parameters = new()
Role = Role.User,
},
],
- Model = Model.ClaudeOpus4_6,
+ Model = Model.ClaudeMythosPreview,
};
var betaMessageTokensCount = await client.Beta.Messages.CountTokens(parameters);
@@ -16180,9 +16172,13 @@ Console.WriteLine(betaMessageTokensCount);
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -20832,9 +20828,13 @@ Console.WriteLine(betaMessageTokensCount);
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -21926,9 +21926,13 @@ Console.WriteLine(betaMessageTokensCount);
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -31730,9 +31734,13 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -33613,10 +33621,6 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
Recommended for advanced use cases only. You usually only need to use `temperature`.
- - `string? UserProfileID`
-
- The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization.
-
- `IReadOnlyList betas`
Header param: Optional header to specify the beta version(s) you want to use.
@@ -33663,8 +33667,6 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BetaMessageBatch:`
@@ -33921,7 +33923,6 @@ BatchCreateParams parameters = new()
],
TopK = 5,
TopP = 0.7,
- UserProfileID = "user_profile_id",
},
},
],
@@ -33996,8 +33997,6 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BetaMessageBatch:`
@@ -34170,8 +34169,6 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BatchListPageResponse:`
@@ -34352,8 +34349,6 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BetaMessageBatch:`
@@ -34518,8 +34513,6 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BetaDeletedMessageBatch:`
@@ -34610,8 +34603,6 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
-
### Returns
- `class BetaMessageBatchIndividualResponse:`
@@ -35425,9 +35416,13 @@ Learn more about the Message Batches API in our [user guide](https://docs.claude
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -36796,9 +36791,13 @@ await foreach (var betaMessageBatchIndividualResponse in client.Beta.Messages.Ba
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -37994,9 +37993,13 @@ await foreach (var betaMessageBatchIndividualResponse in client.Beta.Messages.Ba
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -39154,9 +39157,13 @@ await foreach (var betaMessageBatchIndividualResponse in client.Beta.Messages.Ba
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+ - `"claude-mythos-preview"ClaudeMythosPreview`
+
+ New class of intelligence, strongest in coding and cybersecurity
+
- `"claude-opus-4-6"ClaudeOpus4_6`
- Most intelligent model for building agents and coding
+ Frontier intelligence for long-running agents and coding
- `"claude-sonnet-4-6"ClaudeSonnet4_6`
@@ -39443,23 +39450,373 @@ await foreach (var betaMessageBatchIndividualResponse in client.Beta.Messages.Ba
- `JsonElement Type "succeeded"constant`
-# Files
+# Agents
-## Upload
+## Create
-`FileMetadata Beta.Files.Upload(FileUploadParamsparameters, CancellationTokencancellationToken = default)`
+`BetaManagedAgentsAgent Beta.Agents.Create(AgentCreateParamsparameters, CancellationTokencancellationToken = default)`
-**post** `/v1/files`
+**post** `/v1/agents`
-Upload File
+Create Agent
### Parameters
-- `FileUploadParams parameters`
+- `AgentCreateParams parameters`
- - `required string file`
+ - `required Model model`
- Body param: The file to upload
+ Body param: Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison), e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration control
+
+ - `enum BetaManagedAgentsModel:`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `class BetaManagedAgentsModelConfigParams:`
+
+ An object that defines additional configuration control over model use
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed? Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string name`
+
+ Body param: Human-readable name for the agent. 1-256 characters.
+
+ - `string? description`
+
+ Body param: Description of what the agent does. Up to 2048 characters.
+
+ - `IReadOnlyList mcpServers`
+
+ Body param: MCP servers this agent connects to. Maximum 20. Names must be unique within the array.
+
+ - `required string Name`
+
+ Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ Endpoint URL for the MCP server.
+
+ - `IReadOnlyDictionary metadata`
+
+ Body param: Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
+
+ - `IReadOnlyList skills`
+
+ Body param: Skills available to the agent. Maximum 20.
+
+ - `class BetaManagedAgentsAnthropicSkillParams:`
+
+ An Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ Identifier of the Anthropic skill (e.g., "xlsx").
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `string? Version`
+
+ Version to pin. Defaults to latest if omitted.
+
+ - `class BetaManagedAgentsCustomSkillParams:`
+
+ A user-created custom skill.
+
+ - `required string SkillID`
+
+ Tagged ID of the custom skill (e.g., "skill_01XJ5...").
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `string? Version`
+
+ Version to pin. Defaults to latest if omitted.
+
+ - `string? system`
+
+ Body param: System prompt for the agent. Up to 100,000 characters.
+
+ - `IReadOnlyList tools`
+
+ Body param: Tool configurations available to the agent. Maximum of 128 tools across all toolsets allowed.
+
+ - `class BetaManagedAgentsAgentToolset20260401Params:`
+
+ Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `IReadOnlyList Configs`
+
+ Per-tool configuration overrides.
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `Boolean? Enabled`
+
+ Whether this tool is enabled and available to Claude. Overrides the default_config setting.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `BetaManagedAgentsAgentToolsetDefaultConfigParams? DefaultConfig`
+
+ Default configuration for all tools in a toolset.
+
+ - `Boolean? Enabled`
+
+ Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `class BetaManagedAgentsMcpToolsetParams:`
+
+ Configuration for tools from an MCP server defined in `mcp_servers`.
+
+ - `required string McpServerName`
+
+ Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `IReadOnlyList Configs`
+
+ Per-tool configuration overrides.
+
+ - `required string Name`
+
+ Name of the MCP tool to configure. 1-128 characters.
+
+ - `Boolean? Enabled`
+
+ Whether this tool is enabled. Overrides the `default_config` setting.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `BetaManagedAgentsMcpToolsetDefaultConfigParams? DefaultConfig`
+
+ Default configuration for all tools from an MCP server.
+
+ - `Boolean? Enabled`
+
+ Whether tools are enabled by default. Defaults to true if not specified.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `class BetaManagedAgentsCustomToolParams:`
+
+ A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.
+
+ - `required string Description`
+
+ Description of what the tool does, shown to the agent to help it decide when to use the tool. 1-1024 characters.
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.
+
+ - `required Type Type`
+
+ - `"custom"Custom`
- `IReadOnlyList betas`
@@ -39507,7 +39864,22020 @@ Upload File
- `"output-300k-2026-03-24"Output300k2026_03_24`
- - `"user-profiles-2026-03-24"UserProfiles2026_03_24`
+### Returns
+
+- `class BetaManagedAgentsAgent:`
+
+ A Managed Agents `agent`.
+
+ - `required string ID`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required Int Version`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```csharp
+AgentCreateParams parameters = new()
+{
+ Model = BetaManagedAgentsModel.ClaudeSonnet4_6,
+ Name = "My First Agent",
+};
+
+var betaManagedAgentsAgent = await client.Beta.Agents.Create(parameters);
+
+Console.WriteLine(betaManagedAgentsAgent);
+```
+
+## List
+
+`AgentListPageResponse Beta.Agents.List(AgentListParams?parameters, CancellationTokencancellationToken = default)`
+
+**get** `/v1/agents`
+
+List Agents
+
+### Parameters
+
+- `AgentListParams parameters`
+
+ - `DateTimeOffset createdAtGte`
+
+ Query param: Return agents created at or after this time (inclusive).
+
+ - `DateTimeOffset createdAtLte`
+
+ Query param: Return agents created at or before this time (inclusive).
+
+ - `Boolean includeArchived`
+
+ Query param: Include archived agents in results. Defaults to false.
+
+ - `Int limit`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+ - `string page`
+
+ Query param: Opaque pagination cursor from a previous response.
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class AgentListPageResponse:`
+
+ Paginated list of agents.
+
+ - `IReadOnlyList Data`
+
+ List of agents.
+
+ - `required string ID`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required Int Version`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `string? NextPage`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```csharp
+AgentListParams parameters = new();
+
+var page = await client.Beta.Agents.List(parameters);
+await foreach (var item in page.Paginate())
+{
+ Console.WriteLine(item);
+}
+```
+
+## Retrieve
+
+`BetaManagedAgentsAgent Beta.Agents.Retrieve(AgentRetrieveParamsparameters, CancellationTokencancellationToken = default)`
+
+**get** `/v1/agents/{agent_id}`
+
+Get Agent
+
+### Parameters
+
+- `AgentRetrieveParams parameters`
+
+ - `required string agentID`
+
+ Path param: Path parameter agent_id
+
+ - `Int version`
+
+ Query param: Agent version. Omit for the most recent version. Must be at least 1 if specified.
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaManagedAgentsAgent:`
+
+ A Managed Agents `agent`.
+
+ - `required string ID`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required Int Version`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```csharp
+AgentRetrieveParams parameters = new()
+{
+ AgentID = "agent_011CZkYpogX7uDKUyvBTophP"
+};
+
+var betaManagedAgentsAgent = await client.Beta.Agents.Retrieve(parameters);
+
+Console.WriteLine(betaManagedAgentsAgent);
+```
+
+## Update
+
+`BetaManagedAgentsAgent Beta.Agents.Update(AgentUpdateParamsparameters, CancellationTokencancellationToken = default)`
+
+**post** `/v1/agents/{agent_id}`
+
+Update Agent
+
+### Parameters
+
+- `AgentUpdateParams parameters`
+
+ - `required string agentID`
+
+ Path param: Path parameter agent_id
+
+ - `required Int version`
+
+ Body param: The agent's current version, used to prevent concurrent overwrites. Obtain this value from a create or retrieve response. The request fails if this does not match the server's current version.
+
+ - `string? description`
+
+ Body param: Description. Up to 2048 characters. Omit to preserve; send empty string or null to clear.
+
+ - `IReadOnlyList? mcpServers`
+
+ Body param: MCP servers. Full replacement. Omit to preserve; send empty array or null to clear. Names must be unique. Maximum 20.
+
+ - `required string Name`
+
+ Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ Endpoint URL for the MCP server.
+
+ - `IReadOnlyDictionary? metadata`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.
+
+ - `Model model`
+
+ Body param: Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison), e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration control. Omit to preserve. Cannot be cleared.
+
+ - `enum BetaManagedAgentsModel:`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `class BetaManagedAgentsModelConfigParams:`
+
+ An object that defines additional configuration control over model use
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed? Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `string name`
+
+ Body param: Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.
+
+ - `IReadOnlyList? skills`
+
+ Body param: Skills. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 20.
+
+ - `class BetaManagedAgentsAnthropicSkillParams:`
+
+ An Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ Identifier of the Anthropic skill (e.g., "xlsx").
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `string? Version`
+
+ Version to pin. Defaults to latest if omitted.
+
+ - `class BetaManagedAgentsCustomSkillParams:`
+
+ A user-created custom skill.
+
+ - `required string SkillID`
+
+ Tagged ID of the custom skill (e.g., "skill_01XJ5...").
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `string? Version`
+
+ Version to pin. Defaults to latest if omitted.
+
+ - `string? system`
+
+ Body param: System prompt. Up to 100,000 characters. Omit to preserve; send empty string or null to clear.
+
+ - `IReadOnlyList? tools`
+
+ Body param: Tool configurations available to the agent. Full replacement. Omit to preserve; send empty array or null to clear. Maximum of 128 tools across all toolsets allowed.
+
+ - `class BetaManagedAgentsAgentToolset20260401Params:`
+
+ Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `IReadOnlyList Configs`
+
+ Per-tool configuration overrides.
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `Boolean? Enabled`
+
+ Whether this tool is enabled and available to Claude. Overrides the default_config setting.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `BetaManagedAgentsAgentToolsetDefaultConfigParams? DefaultConfig`
+
+ Default configuration for all tools in a toolset.
+
+ - `Boolean? Enabled`
+
+ Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `class BetaManagedAgentsMcpToolsetParams:`
+
+ Configuration for tools from an MCP server defined in `mcp_servers`.
+
+ - `required string McpServerName`
+
+ Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `IReadOnlyList Configs`
+
+ Per-tool configuration overrides.
+
+ - `required string Name`
+
+ Name of the MCP tool to configure. 1-128 characters.
+
+ - `Boolean? Enabled`
+
+ Whether this tool is enabled. Overrides the `default_config` setting.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `BetaManagedAgentsMcpToolsetDefaultConfigParams? DefaultConfig`
+
+ Default configuration for all tools from an MCP server.
+
+ - `Boolean? Enabled`
+
+ Whether tools are enabled by default. Defaults to true if not specified.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `class BetaManagedAgentsCustomToolParams:`
+
+ A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.
+
+ - `required string Description`
+
+ Description of what the tool does, shown to the agent to help it decide when to use the tool. 1-1024 characters.
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaManagedAgentsAgent:`
+
+ A Managed Agents `agent`.
+
+ - `required string ID`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required Int Version`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```csharp
+AgentUpdateParams parameters = new()
+{
+ AgentID = "agent_011CZkYpogX7uDKUyvBTophP",
+ Version = 1,
+};
+
+var betaManagedAgentsAgent = await client.Beta.Agents.Update(parameters);
+
+Console.WriteLine(betaManagedAgentsAgent);
+```
+
+## Archive
+
+`BetaManagedAgentsAgent Beta.Agents.Archive(AgentArchiveParamsparameters, CancellationTokencancellationToken = default)`
+
+**post** `/v1/agents/{agent_id}/archive`
+
+Archive Agent
+
+### Parameters
+
+- `AgentArchiveParams parameters`
+
+ - `required string agentID`
+
+ Path parameter agent_id
+
+ - `IReadOnlyList betas`
+
+ Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaManagedAgentsAgent:`
+
+ A Managed Agents `agent`.
+
+ - `required string ID`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required Int Version`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Example
+
+```csharp
+AgentArchiveParams parameters = new()
+{
+ AgentID = "agent_011CZkYpogX7uDKUyvBTophP"
+};
+
+var betaManagedAgentsAgent = await client.Beta.Agents.Archive(parameters);
+
+Console.WriteLine(betaManagedAgentsAgent);
+```
+
+## Domain Types
+
+### Beta Managed Agents Agent
+
+- `class BetaManagedAgentsAgent:`
+
+ A Managed Agents `agent`.
+
+ - `required string ID`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required Int Version`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+### Beta Managed Agents Agent Tool Config
+
+- `class BetaManagedAgentsAgentToolConfig:`
+
+ Configuration for a specific agent tool.
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents Agent Tool Config Params
+
+- `class BetaManagedAgentsAgentToolConfigParams:`
+
+ Configuration override for a specific tool within a toolset.
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `Boolean? Enabled`
+
+ Whether this tool is enabled and available to Claude. Overrides the default_config setting.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents Agent Toolset Default Config
+
+- `class BetaManagedAgentsAgentToolsetDefaultConfig:`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents Agent Toolset Default Config Params
+
+- `class BetaManagedAgentsAgentToolsetDefaultConfigParams:`
+
+ Default configuration for all tools in a toolset.
+
+ - `Boolean? Enabled`
+
+ Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents Agent Toolset20260401
+
+- `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+### Beta Managed Agents Agent Toolset20260401 Params
+
+- `class BetaManagedAgentsAgentToolset20260401Params:`
+
+ Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `IReadOnlyList Configs`
+
+ Per-tool configuration overrides.
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `Boolean? Enabled`
+
+ Whether this tool is enabled and available to Claude. Overrides the default_config setting.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `BetaManagedAgentsAgentToolsetDefaultConfigParams? DefaultConfig`
+
+ Default configuration for all tools in a toolset.
+
+ - `Boolean? Enabled`
+
+ Whether tools are enabled and available to Claude by default. Defaults to true if not specified.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents Always Allow Policy
+
+- `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+### Beta Managed Agents Always Ask Policy
+
+- `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents Anthropic Skill
+
+- `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+### Beta Managed Agents Anthropic Skill Params
+
+- `class BetaManagedAgentsAnthropicSkillParams:`
+
+ An Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ Identifier of the Anthropic skill (e.g., "xlsx").
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `string? Version`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents Custom Skill
+
+- `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+### Beta Managed Agents Custom Skill Params
+
+- `class BetaManagedAgentsCustomSkillParams:`
+
+ A user-created custom skill.
+
+ - `required string SkillID`
+
+ Tagged ID of the custom skill (e.g., "skill_01XJ5...").
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `string? Version`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents Custom Tool
+
+- `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+### Beta Managed Agents Custom Tool Input Schema
+
+- `class BetaManagedAgentsCustomToolInputSchema:`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+### Beta Managed Agents Custom Tool Params
+
+- `class BetaManagedAgentsCustomToolParams:`
+
+ A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.
+
+ - `required string Description`
+
+ Description of what the tool does, shown to the agent to help it decide when to use the tool. 1-1024 characters.
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+### Beta Managed Agents MCP Server URL Definition
+
+- `class BetaManagedAgentsMcpServerUrlDefinition:`
+
+ URL-based MCP server connection as returned in API responses.
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+### Beta Managed Agents MCP Tool Config
+
+- `class BetaManagedAgentsMcpToolConfig:`
+
+ Resolved configuration for a specific MCP tool.
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents MCP Tool Config Params
+
+- `class BetaManagedAgentsMcpToolConfigParams:`
+
+ Configuration override for a specific MCP tool.
+
+ - `required string Name`
+
+ Name of the MCP tool to configure. 1-128 characters.
+
+ - `Boolean? Enabled`
+
+ Whether this tool is enabled. Overrides the `default_config` setting.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents MCP Toolset
+
+- `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+### Beta Managed Agents MCP Toolset Default Config
+
+- `class BetaManagedAgentsMcpToolsetDefaultConfig:`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents MCP Toolset Default Config Params
+
+- `class BetaManagedAgentsMcpToolsetDefaultConfigParams:`
+
+ Default configuration for all tools from an MCP server.
+
+ - `Boolean? Enabled`
+
+ Whether tools are enabled by default. Defaults to true if not specified.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents MCP Toolset Params
+
+- `class BetaManagedAgentsMcpToolsetParams:`
+
+ Configuration for tools from an MCP server defined in `mcp_servers`.
+
+ - `required string McpServerName`
+
+ Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `IReadOnlyList Configs`
+
+ Per-tool configuration overrides.
+
+ - `required string Name`
+
+ Name of the MCP tool to configure. 1-128 characters.
+
+ - `Boolean? Enabled`
+
+ Whether this tool is enabled. Overrides the `default_config` setting.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `BetaManagedAgentsMcpToolsetDefaultConfigParams? DefaultConfig`
+
+ Default configuration for all tools from an MCP server.
+
+ - `Boolean? Enabled`
+
+ Whether tools are enabled by default. Defaults to true if not specified.
+
+ - `PermissionPolicy? PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+### Beta Managed Agents Model Config
+
+- `class BetaManagedAgentsModelConfig:`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+### Beta Managed Agents Model Config Params
+
+- `class BetaManagedAgentsModelConfigParams:`
+
+ An object that defines additional configuration control over model use
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed? Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+### Beta Managed Agents Skill Params
+
+- `class BetaManagedAgentsSkillParams: A class that can be one of several variants.union`
+
+ Skill to load in the session container.
+
+ - `class BetaManagedAgentsAnthropicSkillParams:`
+
+ An Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ Identifier of the Anthropic skill (e.g., "xlsx").
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `string? Version`
+
+ Version to pin. Defaults to latest if omitted.
+
+ - `class BetaManagedAgentsCustomSkillParams:`
+
+ A user-created custom skill.
+
+ - `required string SkillID`
+
+ Tagged ID of the custom skill (e.g., "skill_01XJ5...").
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `string? Version`
+
+ Version to pin. Defaults to latest if omitted.
+
+### Beta Managed Agents URL MCP Server Params
+
+- `class BetaManagedAgentsUrlMcpServerParams:`
+
+ URL-based MCP server connection.
+
+ - `required string Name`
+
+ Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ Endpoint URL for the MCP server.
+
+# Versions
+
+## List
+
+`VersionListPageResponse Beta.Agents.Versions.List(VersionListParamsparameters, CancellationTokencancellationToken = default)`
+
+**get** `/v1/agents/{agent_id}/versions`
+
+List Agent Versions
+
+### Parameters
+
+- `VersionListParams parameters`
+
+ - `required string agentID`
+
+ Path param: Path parameter agent_id
+
+ - `Int limit`
+
+ Query param: Maximum results per page. Default 20, maximum 100.
+
+ - `string page`
+
+ Query param: Opaque pagination cursor.
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class VersionListPageResponse:`
+
+ Paginated list of agent versions.
+
+ - `IReadOnlyList Data`
+
+ Agent versions.
+
+ - `required string ID`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required Int Version`
+
+ The agent's current version. Starts at 1 and increments when the agent is modified.
+
+ - `string? NextPage`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```csharp
+VersionListParams parameters = new()
+{
+ AgentID = "agent_011CZkYpogX7uDKUyvBTophP"
+};
+
+var page = await client.Beta.Agents.Versions.List(parameters);
+await foreach (var item in page.Paginate())
+{
+ Console.WriteLine(item);
+}
+```
+
+# Environments
+
+## Create
+
+`BetaEnvironment Beta.Environments.Create(EnvironmentCreateParamsparameters, CancellationTokencancellationToken = default)`
+
+**post** `/v1/environments`
+
+Create a new environment with the specified configuration.
+
+### Parameters
+
+- `EnvironmentCreateParams parameters`
+
+ - `required string name`
+
+ Body param: Human-readable name for the environment
+
+ - `BetaCloudConfigParams? config`
+
+ Body param: Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `string? description`
+
+ Body param: Optional description of the environment
+
+ - `IReadOnlyDictionary metadata`
+
+ Body param: User-provided metadata key-value pairs
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaEnvironment:`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `required string ID`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `required string? ArchivedAt`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `required BetaCloudConfig Config`
+
+ `cloud` environment configuration.
+
+ - `required Networking Networking`
+
+ Network configuration policy.
+
+ - `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+ - `class BetaLimitedNetwork:`
+
+ Limited network access.
+
+ - `required Boolean AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `required Boolean AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `required IReadOnlyList AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `required BetaPackages Packages`
+
+ Package manager configuration.
+
+ - `required IReadOnlyList Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `required IReadOnlyList Cargo`
+
+ Rust packages to install
+
+ - `required IReadOnlyList Gem`
+
+ Ruby packages to install
+
+ - `required IReadOnlyList Go`
+
+ Go packages to install
+
+ - `required IReadOnlyList Npm`
+
+ Node.js packages to install
+
+ - `required IReadOnlyList Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+ - `JsonElement Type "cloud"constant`
+
+ Environment type
+
+ - `required string CreatedAt`
+
+ RFC 3339 timestamp when environment was created
+
+ - `required string Description`
+
+ User-provided description for the environment
+
+ - `required IReadOnlyDictionary Metadata`
+
+ User-provided metadata key-value pairs
+
+ - `required string Name`
+
+ Human-readable name for the environment
+
+ - `JsonElement Type "environment"constant`
+
+ The type of object (always 'environment')
+
+ - `required string UpdatedAt`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```csharp
+EnvironmentCreateParams parameters = new() { Name = "python-data-analysis" };
+
+var betaEnvironment = await client.Beta.Environments.Create(parameters);
+
+Console.WriteLine(betaEnvironment);
+```
+
+## List
+
+`EnvironmentListPageResponse Beta.Environments.List(EnvironmentListParams?parameters, CancellationTokencancellationToken = default)`
+
+**get** `/v1/environments`
+
+List environments with pagination support.
+
+### Parameters
+
+- `EnvironmentListParams parameters`
+
+ - `Boolean includeArchived`
+
+ Query param: Include archived environments in the response
+
+ - `Long limit`
+
+ Query param: Maximum number of environments to return
+
+ - `string? page`
+
+ Query param: Opaque cursor from previous response for pagination. Pass the `next_page` value from the previous response.
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class EnvironmentListPageResponse:`
+
+ Response when listing environments.
+
+ This response model uses opaque cursor-based pagination. Use the `page`
+ query parameter with the value from `next_page` to fetch the next page.
+
+ - `required IReadOnlyList Data`
+
+ List of environments.
+
+ - `required string ID`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `required string? ArchivedAt`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `required BetaCloudConfig Config`
+
+ `cloud` environment configuration.
+
+ - `required Networking Networking`
+
+ Network configuration policy.
+
+ - `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+ - `class BetaLimitedNetwork:`
+
+ Limited network access.
+
+ - `required Boolean AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `required Boolean AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `required IReadOnlyList AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `required BetaPackages Packages`
+
+ Package manager configuration.
+
+ - `required IReadOnlyList Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `required IReadOnlyList Cargo`
+
+ Rust packages to install
+
+ - `required IReadOnlyList Gem`
+
+ Ruby packages to install
+
+ - `required IReadOnlyList Go`
+
+ Go packages to install
+
+ - `required IReadOnlyList Npm`
+
+ Node.js packages to install
+
+ - `required IReadOnlyList Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+ - `JsonElement Type "cloud"constant`
+
+ Environment type
+
+ - `required string CreatedAt`
+
+ RFC 3339 timestamp when environment was created
+
+ - `required string Description`
+
+ User-provided description for the environment
+
+ - `required IReadOnlyDictionary Metadata`
+
+ User-provided metadata key-value pairs
+
+ - `required string Name`
+
+ Human-readable name for the environment
+
+ - `JsonElement Type "environment"constant`
+
+ The type of object (always 'environment')
+
+ - `required string UpdatedAt`
+
+ RFC 3339 timestamp when environment was last updated
+
+ - `required string? NextPage`
+
+ Token for fetching the next page of results. If `null`, there are no more results available. Pass this value to the `page` parameter in the next request.
+
+### Example
+
+```csharp
+EnvironmentListParams parameters = new();
+
+var page = await client.Beta.Environments.List(parameters);
+await foreach (var item in page.Paginate())
+{
+ Console.WriteLine(item);
+}
+```
+
+## Retrieve
+
+`BetaEnvironment Beta.Environments.Retrieve(EnvironmentRetrieveParamsparameters, CancellationTokencancellationToken = default)`
+
+**get** `/v1/environments/{environment_id}`
+
+Retrieve a specific environment by ID.
+
+### Parameters
+
+- `EnvironmentRetrieveParams parameters`
+
+ - `required string environmentID`
+
+ - `IReadOnlyList betas`
+
+ Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaEnvironment:`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `required string ID`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `required string? ArchivedAt`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `required BetaCloudConfig Config`
+
+ `cloud` environment configuration.
+
+ - `required Networking Networking`
+
+ Network configuration policy.
+
+ - `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+ - `class BetaLimitedNetwork:`
+
+ Limited network access.
+
+ - `required Boolean AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `required Boolean AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `required IReadOnlyList AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `required BetaPackages Packages`
+
+ Package manager configuration.
+
+ - `required IReadOnlyList Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `required IReadOnlyList Cargo`
+
+ Rust packages to install
+
+ - `required IReadOnlyList Gem`
+
+ Ruby packages to install
+
+ - `required IReadOnlyList Go`
+
+ Go packages to install
+
+ - `required IReadOnlyList Npm`
+
+ Node.js packages to install
+
+ - `required IReadOnlyList Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+ - `JsonElement Type "cloud"constant`
+
+ Environment type
+
+ - `required string CreatedAt`
+
+ RFC 3339 timestamp when environment was created
+
+ - `required string Description`
+
+ User-provided description for the environment
+
+ - `required IReadOnlyDictionary Metadata`
+
+ User-provided metadata key-value pairs
+
+ - `required string Name`
+
+ Human-readable name for the environment
+
+ - `JsonElement Type "environment"constant`
+
+ The type of object (always 'environment')
+
+ - `required string UpdatedAt`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```csharp
+EnvironmentRetrieveParams parameters = new()
+{
+ EnvironmentID = "env_011CZkZ9X2dpNyB7HsEFoRfW"
+};
+
+var betaEnvironment = await client.Beta.Environments.Retrieve(parameters);
+
+Console.WriteLine(betaEnvironment);
+```
+
+## Update
+
+`BetaEnvironment Beta.Environments.Update(EnvironmentUpdateParamsparameters, CancellationTokencancellationToken = default)`
+
+**post** `/v1/environments/{environment_id}`
+
+Update an existing environment's configuration.
+
+### Parameters
+
+- `EnvironmentUpdateParams parameters`
+
+ - `required string environmentID`
+
+ Path param
+
+ - `BetaCloudConfigParams? config`
+
+ Body param: Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `string? description`
+
+ Body param: Updated description of the environment
+
+ - `IReadOnlyDictionary metadata`
+
+ Body param: User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.
+
+ - `string? name`
+
+ Body param: Updated name for the environment
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaEnvironment:`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `required string ID`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `required string? ArchivedAt`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `required BetaCloudConfig Config`
+
+ `cloud` environment configuration.
+
+ - `required Networking Networking`
+
+ Network configuration policy.
+
+ - `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+ - `class BetaLimitedNetwork:`
+
+ Limited network access.
+
+ - `required Boolean AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `required Boolean AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `required IReadOnlyList AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `required BetaPackages Packages`
+
+ Package manager configuration.
+
+ - `required IReadOnlyList Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `required IReadOnlyList Cargo`
+
+ Rust packages to install
+
+ - `required IReadOnlyList Gem`
+
+ Ruby packages to install
+
+ - `required IReadOnlyList Go`
+
+ Go packages to install
+
+ - `required IReadOnlyList Npm`
+
+ Node.js packages to install
+
+ - `required IReadOnlyList Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+ - `JsonElement Type "cloud"constant`
+
+ Environment type
+
+ - `required string CreatedAt`
+
+ RFC 3339 timestamp when environment was created
+
+ - `required string Description`
+
+ User-provided description for the environment
+
+ - `required IReadOnlyDictionary Metadata`
+
+ User-provided metadata key-value pairs
+
+ - `required string Name`
+
+ Human-readable name for the environment
+
+ - `JsonElement Type "environment"constant`
+
+ The type of object (always 'environment')
+
+ - `required string UpdatedAt`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```csharp
+EnvironmentUpdateParams parameters = new()
+{
+ EnvironmentID = "env_011CZkZ9X2dpNyB7HsEFoRfW"
+};
+
+var betaEnvironment = await client.Beta.Environments.Update(parameters);
+
+Console.WriteLine(betaEnvironment);
+```
+
+## Delete
+
+`BetaEnvironmentDeleteResponse Beta.Environments.Delete(EnvironmentDeleteParamsparameters, CancellationTokencancellationToken = default)`
+
+**delete** `/v1/environments/{environment_id}`
+
+Delete an environment by ID. Returns a confirmation of the deletion.
+
+### Parameters
+
+- `EnvironmentDeleteParams parameters`
+
+ - `required string environmentID`
+
+ - `IReadOnlyList betas`
+
+ Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaEnvironmentDeleteResponse:`
+
+ Response after deleting an environment.
+
+ - `required string ID`
+
+ Environment identifier
+
+ - `JsonElement Type "environment_deleted"constant`
+
+ The type of response
+
+### Example
+
+```csharp
+EnvironmentDeleteParams parameters = new()
+{
+ EnvironmentID = "env_011CZkZ9X2dpNyB7HsEFoRfW"
+};
+
+var betaEnvironmentDeleteResponse = await client.Beta.Environments.Delete(parameters);
+
+Console.WriteLine(betaEnvironmentDeleteResponse);
+```
+
+## Archive
+
+`BetaEnvironment Beta.Environments.Archive(EnvironmentArchiveParamsparameters, CancellationTokencancellationToken = default)`
+
+**post** `/v1/environments/{environment_id}/archive`
+
+Archive an environment by ID. Archived environments cannot be used to create new sessions.
+
+### Parameters
+
+- `EnvironmentArchiveParams parameters`
+
+ - `required string environmentID`
+
+ - `IReadOnlyList betas`
+
+ Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaEnvironment:`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `required string ID`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `required string? ArchivedAt`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `required BetaCloudConfig Config`
+
+ `cloud` environment configuration.
+
+ - `required Networking Networking`
+
+ Network configuration policy.
+
+ - `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+ - `class BetaLimitedNetwork:`
+
+ Limited network access.
+
+ - `required Boolean AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `required Boolean AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `required IReadOnlyList AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `required BetaPackages Packages`
+
+ Package manager configuration.
+
+ - `required IReadOnlyList Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `required IReadOnlyList Cargo`
+
+ Rust packages to install
+
+ - `required IReadOnlyList Gem`
+
+ Ruby packages to install
+
+ - `required IReadOnlyList Go`
+
+ Go packages to install
+
+ - `required IReadOnlyList Npm`
+
+ Node.js packages to install
+
+ - `required IReadOnlyList Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+ - `JsonElement Type "cloud"constant`
+
+ Environment type
+
+ - `required string CreatedAt`
+
+ RFC 3339 timestamp when environment was created
+
+ - `required string Description`
+
+ User-provided description for the environment
+
+ - `required IReadOnlyDictionary Metadata`
+
+ User-provided metadata key-value pairs
+
+ - `required string Name`
+
+ Human-readable name for the environment
+
+ - `JsonElement Type "environment"constant`
+
+ The type of object (always 'environment')
+
+ - `required string UpdatedAt`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Example
+
+```csharp
+EnvironmentArchiveParams parameters = new()
+{
+ EnvironmentID = "env_011CZkZ9X2dpNyB7HsEFoRfW"
+};
+
+var betaEnvironment = await client.Beta.Environments.Archive(parameters);
+
+Console.WriteLine(betaEnvironment);
+```
+
+## Domain Types
+
+### Beta Cloud Config
+
+- `class BetaCloudConfig:`
+
+ `cloud` environment configuration.
+
+ - `required Networking Networking`
+
+ Network configuration policy.
+
+ - `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+ - `class BetaLimitedNetwork:`
+
+ Limited network access.
+
+ - `required Boolean AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `required Boolean AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `required IReadOnlyList AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `required BetaPackages Packages`
+
+ Package manager configuration.
+
+ - `required IReadOnlyList Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `required IReadOnlyList Cargo`
+
+ Rust packages to install
+
+ - `required IReadOnlyList Gem`
+
+ Ruby packages to install
+
+ - `required IReadOnlyList Go`
+
+ Go packages to install
+
+ - `required IReadOnlyList Npm`
+
+ Node.js packages to install
+
+ - `required IReadOnlyList Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+ - `JsonElement Type "cloud"constant`
+
+ Environment type
+
+### Beta Cloud Config Params
+
+- `class BetaCloudConfigParams:`
+
+ Request params for `cloud` environment configuration.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `JsonElement Type "cloud"constant`
+
+ Environment type
+
+ - `Networking? Networking`
+
+ Network configuration policy. Omit on update to preserve the existing value.
+
+ - `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+ - `class BetaLimitedNetworkParams:`
+
+ Limited network request params.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `Boolean? AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `Boolean? AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `IReadOnlyList? AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `BetaPackagesParams? Packages`
+
+ Specify packages (and optionally their versions) available in this environment.
+
+ When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest.
+
+ - `IReadOnlyList? Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `IReadOnlyList? Cargo`
+
+ Rust packages to install
+
+ - `IReadOnlyList? Gem`
+
+ Ruby packages to install
+
+ - `IReadOnlyList? Go`
+
+ Go packages to install
+
+ - `IReadOnlyList? Npm`
+
+ Node.js packages to install
+
+ - `IReadOnlyList? Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+### Beta Environment
+
+- `class BetaEnvironment:`
+
+ Unified Environment resource for both cloud and BYOC environments.
+
+ - `required string ID`
+
+ Environment identifier (e.g., 'env_...')
+
+ - `required string? ArchivedAt`
+
+ RFC 3339 timestamp when environment was archived, or null if not archived
+
+ - `required BetaCloudConfig Config`
+
+ `cloud` environment configuration.
+
+ - `required Networking Networking`
+
+ Network configuration policy.
+
+ - `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+ - `class BetaLimitedNetwork:`
+
+ Limited network access.
+
+ - `required Boolean AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `required Boolean AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `required IReadOnlyList AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `required BetaPackages Packages`
+
+ Package manager configuration.
+
+ - `required IReadOnlyList Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `required IReadOnlyList Cargo`
+
+ Rust packages to install
+
+ - `required IReadOnlyList Gem`
+
+ Ruby packages to install
+
+ - `required IReadOnlyList Go`
+
+ Go packages to install
+
+ - `required IReadOnlyList Npm`
+
+ Node.js packages to install
+
+ - `required IReadOnlyList Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+ - `JsonElement Type "cloud"constant`
+
+ Environment type
+
+ - `required string CreatedAt`
+
+ RFC 3339 timestamp when environment was created
+
+ - `required string Description`
+
+ User-provided description for the environment
+
+ - `required IReadOnlyDictionary Metadata`
+
+ User-provided metadata key-value pairs
+
+ - `required string Name`
+
+ Human-readable name for the environment
+
+ - `JsonElement Type "environment"constant`
+
+ The type of object (always 'environment')
+
+ - `required string UpdatedAt`
+
+ RFC 3339 timestamp when environment was last updated
+
+### Beta Environment Delete Response
+
+- `class BetaEnvironmentDeleteResponse:`
+
+ Response after deleting an environment.
+
+ - `required string ID`
+
+ Environment identifier
+
+ - `JsonElement Type "environment_deleted"constant`
+
+ The type of response
+
+### Beta Limited Network
+
+- `class BetaLimitedNetwork:`
+
+ Limited network access.
+
+ - `required Boolean AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.
+
+ - `required Boolean AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.
+
+ - `required IReadOnlyList AllowedHosts`
+
+ Specifies domains the container can reach.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+### Beta Limited Network Params
+
+- `class BetaLimitedNetworkParams:`
+
+ Limited network request params.
+
+ Fields default to null; on update, omitted fields preserve the
+ existing value.
+
+ - `JsonElement Type "limited"constant`
+
+ Network policy type
+
+ - `Boolean? AllowMcpServers`
+
+ Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `Boolean? AllowPackageManagers`
+
+ Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false`.
+
+ - `IReadOnlyList? AllowedHosts`
+
+ Specifies domains the container can reach.
+
+### Beta Packages
+
+- `class BetaPackages:`
+
+ Packages (and their versions) available in this environment.
+
+ - `required IReadOnlyList Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `required IReadOnlyList Cargo`
+
+ Rust packages to install
+
+ - `required IReadOnlyList Gem`
+
+ Ruby packages to install
+
+ - `required IReadOnlyList Go`
+
+ Go packages to install
+
+ - `required IReadOnlyList Npm`
+
+ Node.js packages to install
+
+ - `required IReadOnlyList Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+### Beta Packages Params
+
+- `class BetaPackagesParams:`
+
+ Specify packages (and optionally their versions) available in this environment.
+
+ When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest.
+
+ - `IReadOnlyList? Apt`
+
+ Ubuntu/Debian packages to install
+
+ - `IReadOnlyList? Cargo`
+
+ Rust packages to install
+
+ - `IReadOnlyList? Gem`
+
+ Ruby packages to install
+
+ - `IReadOnlyList? Go`
+
+ Go packages to install
+
+ - `IReadOnlyList? Npm`
+
+ Node.js packages to install
+
+ - `IReadOnlyList? Pip`
+
+ Python packages to install
+
+ - `Type Type`
+
+ Package configuration type
+
+ - `"packages"Packages`
+
+### Beta Unrestricted Network
+
+- `class BetaUnrestrictedNetwork:`
+
+ Unrestricted network access.
+
+ - `JsonElement Type "unrestricted"constant`
+
+ Network policy type
+
+# Sessions
+
+## Create
+
+`BetaManagedAgentsSession Beta.Sessions.Create(SessionCreateParamsparameters, CancellationTokencancellationToken = default)`
+
+**post** `/v1/sessions`
+
+Create Session
+
+### Parameters
+
+- `SessionCreateParams parameters`
+
+ - `required Agent agent`
+
+ Body param: Agent identifier. Accepts the `agent` ID string, which pins the latest version for the session, or an `agent` object with both id and version specified.
+
+ - `string`
+
+ - `class BetaManagedAgentsAgentParams:`
+
+ Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version
+
+ - `required string ID`
+
+ The `agent` ID.
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `Int Version`
+
+ The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.
+
+ - `required string environmentID`
+
+ Body param: ID of the `environment` defining the container configuration for this session.
+
+ - `IReadOnlyDictionary metadata`
+
+ Body param: Arbitrary key-value metadata attached to the session.
+
+ - `IReadOnlyList resources`
+
+ Body param: Resources (e.g. repositories, files) to mount into the session's container.
+
+ - `class BetaManagedAgentsGitHubRepositoryResourceParams:`
+
+ Mount a GitHub repository into the session's container.
+
+ - `required string AuthorizationToken`
+
+ GitHub authorization token used to clone the repository.
+
+ - `required Type Type`
+
+ - `"github_repository"GitHubRepository`
+
+ - `required string Url`
+
+ Github URL of the repository
+
+ - `Checkout? Checkout`
+
+ Branch or commit to check out. Defaults to the repository's default branch.
+
+ - `class BetaManagedAgentsBranchCheckout:`
+
+ - `required string Name`
+
+ Branch name to check out.
+
+ - `required Type Type`
+
+ - `"branch"Branch`
+
+ - `class BetaManagedAgentsCommitCheckout:`
+
+ - `required string Sha`
+
+ Full commit SHA to check out.
+
+ - `required Type Type`
+
+ - `"commit"Commit`
+
+ - `string? MountPath`
+
+ Mount path in the container. Defaults to `/workspace/`.
+
+ - `class BetaManagedAgentsFileResourceParams:`
+
+ Mount a file uploaded via the Files API into the session.
+
+ - `required string FileID`
+
+ ID of a previously uploaded file.
+
+ - `required Type Type`
+
+ - `"file"File`
+
+ - `string? MountPath`
+
+ Mount path in the container. Defaults to `/mnt/session/uploads/`.
+
+ - `string? title`
+
+ Body param: Human-readable session title.
+
+ - `IReadOnlyList vaultIds`
+
+ Body param: Vault IDs for stored credentials the agent can use during the session.
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaManagedAgentsSession:`
+
+ A Managed Agents `session`.
+
+ - `required string ID`
+
+ - `required BetaManagedAgentsSessionAgent Agent`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `required string ID`
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required Int Version`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string EnvironmentID`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required IReadOnlyList Resources`
+
+ - `class BetaManagedAgentsGitHubRepositoryResource:`
+
+ - `required string ID`
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string MountPath`
+
+ - `required Type Type`
+
+ - `"github_repository"GitHubRepository`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string Url`
+
+ - `Checkout? Checkout`
+
+ - `class BetaManagedAgentsBranchCheckout:`
+
+ - `required string Name`
+
+ Branch name to check out.
+
+ - `required Type Type`
+
+ - `"branch"Branch`
+
+ - `class BetaManagedAgentsCommitCheckout:`
+
+ - `required string Sha`
+
+ Full commit SHA to check out.
+
+ - `required Type Type`
+
+ - `"commit"Commit`
+
+ - `class BetaManagedAgentsFileResource:`
+
+ - `required string ID`
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string FileID`
+
+ - `required string MountPath`
+
+ - `required Type Type`
+
+ - `"file"File`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required BetaManagedAgentsSessionStats Stats`
+
+ Timing statistics for a session.
+
+ - `Double ActiveSeconds`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `Double DurationSeconds`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `required Status Status`
+
+ SessionStatus enum
+
+ - `"rescheduling"Rescheduling`
+
+ - `"running"Running`
+
+ - `"idle"Idle`
+
+ - `"terminated"Terminated`
+
+ - `required string? Title`
+
+ - `required Type Type`
+
+ - `"session"Session`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required BetaManagedAgentsSessionUsage Usage`
+
+ Cumulative token usage for a session across all turns.
+
+ - `BetaManagedAgentsCacheCreationUsage CacheCreation`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `Int Ephemeral1hInputTokens`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `Int Ephemeral5mInputTokens`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `Int CacheReadInputTokens`
+
+ Total tokens read from prompt cache.
+
+ - `Int InputTokens`
+
+ Total input tokens consumed across all turns.
+
+ - `Int OutputTokens`
+
+ Total output tokens generated across all turns.
+
+ - `required IReadOnlyList VaultIds`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```csharp
+SessionCreateParams parameters = new()
+{
+ Agent = "agent_011CZkYpogX7uDKUyvBTophP",
+ EnvironmentID = "env_011CZkZ9X2dpNyB7HsEFoRfW",
+};
+
+var betaManagedAgentsSession = await client.Beta.Sessions.Create(parameters);
+
+Console.WriteLine(betaManagedAgentsSession);
+```
+
+## List
+
+`SessionListPageResponse Beta.Sessions.List(SessionListParams?parameters, CancellationTokencancellationToken = default)`
+
+**get** `/v1/sessions`
+
+List Sessions
+
+### Parameters
+
+- `SessionListParams parameters`
+
+ - `string agentID`
+
+ Query param: Filter sessions created with this agent ID.
+
+ - `Int agentVersion`
+
+ Query param: Filter by agent version. Only applies when agent_id is also set.
+
+ - `DateTimeOffset createdAtGt`
+
+ Query param: Return sessions created after this time (exclusive).
+
+ - `DateTimeOffset createdAtGte`
+
+ Query param: Return sessions created at or after this time (inclusive).
+
+ - `DateTimeOffset createdAtLt`
+
+ Query param: Return sessions created before this time (exclusive).
+
+ - `DateTimeOffset createdAtLte`
+
+ Query param: Return sessions created at or before this time (inclusive).
+
+ - `Boolean includeArchived`
+
+ Query param: When true, includes archived sessions. Default: false (exclude archived).
+
+ - `Int limit`
+
+ Query param: Maximum number of results to return.
+
+ - `Order order`
+
+ Query param: Sort direction for results, ordered by created_at. Defaults to desc (newest first).
+
+ - `"asc"Asc`
+
+ - `"desc"Desc`
+
+ - `string page`
+
+ Query param: Opaque pagination cursor from a previous response's next_page.
+
+ - `IReadOnlyList betas`
+
+ Header param: Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class SessionListPageResponse:`
+
+ Paginated list of sessions.
+
+ - `IReadOnlyList Data`
+
+ List of sessions.
+
+ - `required string ID`
+
+ - `required BetaManagedAgentsSessionAgent Agent`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `required string ID`
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required Int Version`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string EnvironmentID`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required IReadOnlyList Resources`
+
+ - `class BetaManagedAgentsGitHubRepositoryResource:`
+
+ - `required string ID`
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string MountPath`
+
+ - `required Type Type`
+
+ - `"github_repository"GitHubRepository`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string Url`
+
+ - `Checkout? Checkout`
+
+ - `class BetaManagedAgentsBranchCheckout:`
+
+ - `required string Name`
+
+ Branch name to check out.
+
+ - `required Type Type`
+
+ - `"branch"Branch`
+
+ - `class BetaManagedAgentsCommitCheckout:`
+
+ - `required string Sha`
+
+ Full commit SHA to check out.
+
+ - `required Type Type`
+
+ - `"commit"Commit`
+
+ - `class BetaManagedAgentsFileResource:`
+
+ - `required string ID`
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string FileID`
+
+ - `required string MountPath`
+
+ - `required Type Type`
+
+ - `"file"File`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required BetaManagedAgentsSessionStats Stats`
+
+ Timing statistics for a session.
+
+ - `Double ActiveSeconds`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `Double DurationSeconds`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `required Status Status`
+
+ SessionStatus enum
+
+ - `"rescheduling"Rescheduling`
+
+ - `"running"Running`
+
+ - `"idle"Idle`
+
+ - `"terminated"Terminated`
+
+ - `required string? Title`
+
+ - `required Type Type`
+
+ - `"session"Session`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required BetaManagedAgentsSessionUsage Usage`
+
+ Cumulative token usage for a session across all turns.
+
+ - `BetaManagedAgentsCacheCreationUsage CacheCreation`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `Int Ephemeral1hInputTokens`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `Int Ephemeral5mInputTokens`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `Int CacheReadInputTokens`
+
+ Total tokens read from prompt cache.
+
+ - `Int InputTokens`
+
+ Total input tokens consumed across all turns.
+
+ - `Int OutputTokens`
+
+ Total output tokens generated across all turns.
+
+ - `required IReadOnlyList VaultIds`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+ - `string? NextPage`
+
+ Opaque cursor for the next page. Null when no more results.
+
+### Example
+
+```csharp
+SessionListParams parameters = new();
+
+var page = await client.Beta.Sessions.List(parameters);
+await foreach (var item in page.Paginate())
+{
+ Console.WriteLine(item);
+}
+```
+
+## Retrieve
+
+`BetaManagedAgentsSession Beta.Sessions.Retrieve(SessionRetrieveParamsparameters, CancellationTokencancellationToken = default)`
+
+**get** `/v1/sessions/{session_id}`
+
+Get Session
+
+### Parameters
+
+- `SessionRetrieveParams parameters`
+
+ - `required string sessionID`
+
+ Path parameter session_id
+
+ - `IReadOnlyList betas`
+
+ Optional header to specify the beta version(s) you want to use.
+
+ - `"message-batches-2024-09-24"MessageBatches2024_09_24`
+
+ - `"prompt-caching-2024-07-31"PromptCaching2024_07_31`
+
+ - `"computer-use-2024-10-22"ComputerUse2024_10_22`
+
+ - `"computer-use-2025-01-24"ComputerUse2025_01_24`
+
+ - `"pdfs-2024-09-25"Pdfs2024_09_25`
+
+ - `"token-counting-2024-11-01"TokenCounting2024_11_01`
+
+ - `"token-efficient-tools-2025-02-19"TokenEfficientTools2025_02_19`
+
+ - `"output-128k-2025-02-19"Output128k2025_02_19`
+
+ - `"files-api-2025-04-14"FilesApi2025_04_14`
+
+ - `"mcp-client-2025-04-04"McpClient2025_04_04`
+
+ - `"mcp-client-2025-11-20"McpClient2025_11_20`
+
+ - `"dev-full-thinking-2025-05-14"DevFullThinking2025_05_14`
+
+ - `"interleaved-thinking-2025-05-14"InterleavedThinking2025_05_14`
+
+ - `"code-execution-2025-05-22"CodeExecution2025_05_22`
+
+ - `"extended-cache-ttl-2025-04-11"ExtendedCacheTtl2025_04_11`
+
+ - `"context-1m-2025-08-07"Context1m2025_08_07`
+
+ - `"context-management-2025-06-27"ContextManagement2025_06_27`
+
+ - `"model-context-window-exceeded-2025-08-26"ModelContextWindowExceeded2025_08_26`
+
+ - `"skills-2025-10-02"Skills2025_10_02`
+
+ - `"fast-mode-2026-02-01"FastMode2026_02_01`
+
+ - `"output-300k-2026-03-24"Output300k2026_03_24`
+
+### Returns
+
+- `class BetaManagedAgentsSession:`
+
+ A Managed Agents `session`.
+
+ - `required string ID`
+
+ - `required BetaManagedAgentsSessionAgent Agent`
+
+ Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
+
+ - `required string ID`
+
+ - `required string? Description`
+
+ - `required IReadOnlyList McpServers`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"url"Url`
+
+ - `required string Url`
+
+ - `required BetaManagedAgentsModelConfig Model`
+
+ Model identifier and configuration.
+
+ - `required BetaManagedAgentsModel ID`
+
+ The model that will power your agent.
+
+ See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
+
+ - `"claude-opus-4-6"ClaudeOpus4_6`
+
+ Most intelligent model for building agents and coding
+
+ - `"claude-sonnet-4-6"ClaudeSonnet4_6`
+
+ Best combination of speed and intelligence
+
+ - `"claude-haiku-4-5"ClaudeHaiku4_5`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-haiku-4-5-20251001"ClaudeHaiku4_5_20251001`
+
+ Fastest model with near-frontier intelligence
+
+ - `"claude-opus-4-5"ClaudeOpus4_5`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-opus-4-5-20251101"ClaudeOpus4_5_20251101`
+
+ Premium model combining maximum intelligence with practical performance
+
+ - `"claude-sonnet-4-5"ClaudeSonnet4_5`
+
+ High-performance model for agents and coding
+
+ - `"claude-sonnet-4-5-20250929"ClaudeSonnet4_5_20250929`
+
+ High-performance model for agents and coding
+
+ - `Speed Speed`
+
+ 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.
+
+ - `"standard"Standard`
+
+ - `"fast"Fast`
+
+ - `required string Name`
+
+ - `required IReadOnlyList Skills`
+
+ - `class BetaManagedAgentsAnthropicSkill:`
+
+ A resolved Anthropic-managed skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"anthropic"Anthropic`
+
+ - `required string Version`
+
+ - `class BetaManagedAgentsCustomSkill:`
+
+ A resolved user-created custom skill.
+
+ - `required string SkillID`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required string Version`
+
+ - `required string? System`
+
+ - `required IReadOnlyList Tools`
+
+ - `class BetaManagedAgentsAgentToolset20260401:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required Name Name`
+
+ Built-in agent tool identifier.
+
+ - `"bash"Bash`
+
+ - `"edit"Edit`
+
+ - `"read"Read`
+
+ - `"write"Write`
+
+ - `"glob"Glob`
+
+ - `"grep"Grep`
+
+ - `"web_fetch"WebFetch`
+
+ - `"web_search"WebSearch`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsAgentToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for agent tools.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required Type Type`
+
+ - `"agent_toolset_20260401"AgentToolset20260401`
+
+ - `class BetaManagedAgentsMcpToolset:`
+
+ - `required IReadOnlyList Configs`
+
+ - `required Boolean Enabled`
+
+ - `required string Name`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required BetaManagedAgentsMcpToolsetDefaultConfig DefaultConfig`
+
+ Resolved default configuration for all tools from an MCP server.
+
+ - `required Boolean Enabled`
+
+ - `required PermissionPolicy PermissionPolicy`
+
+ Permission policy for tool execution.
+
+ - `class BetaManagedAgentsAlwaysAllowPolicy:`
+
+ Tool calls are automatically approved without user confirmation.
+
+ - `required Type Type`
+
+ - `"always_allow"AlwaysAllow`
+
+ - `class BetaManagedAgentsAlwaysAskPolicy:`
+
+ Tool calls require user confirmation before execution.
+
+ - `required Type Type`
+
+ - `"always_ask"AlwaysAsk`
+
+ - `required string McpServerName`
+
+ - `required Type Type`
+
+ - `"mcp_toolset"McpToolset`
+
+ - `class BetaManagedAgentsCustomTool:`
+
+ A custom tool as returned in API responses.
+
+ - `required string Description`
+
+ - `required BetaManagedAgentsCustomToolInputSchema InputSchema`
+
+ JSON Schema for custom tool input parameters.
+
+ - `IReadOnlyDictionary? Properties`
+
+ JSON Schema properties defining the tool's input parameters.
+
+ - `IReadOnlyList Required`
+
+ List of required property names.
+
+ - `Type Type`
+
+ Must be 'object' for tool input schemas.
+
+ - `"object"Object`
+
+ - `required string Name`
+
+ - `required Type Type`
+
+ - `"custom"Custom`
+
+ - `required Type Type`
+
+ - `"agent"Agent`
+
+ - `required Int Version`
+
+ - `required DateTimeOffset? ArchivedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string EnvironmentID`
+
+ - `required IReadOnlyDictionary Metadata`
+
+ - `required IReadOnlyList Resources`
+
+ - `class BetaManagedAgentsGitHubRepositoryResource:`
+
+ - `required string ID`
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string MountPath`
+
+ - `required Type Type`
+
+ - `"github_repository"GitHubRepository`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string Url`
+
+ - `Checkout? Checkout`
+
+ - `class BetaManagedAgentsBranchCheckout:`
+
+ - `required string Name`
+
+ Branch name to check out.
+
+ - `required Type Type`
+
+ - `"branch"Branch`
+
+ - `class BetaManagedAgentsCommitCheckout:`
+
+ - `required string Sha`
+
+ Full commit SHA to check out.
+
+ - `required Type Type`
+
+ - `"commit"Commit`
+
+ - `class BetaManagedAgentsFileResource:`
+
+ - `required string ID`
+
+ - `required DateTimeOffset CreatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required string FileID`
+
+ - `required string MountPath`
+
+ - `required Type Type`
+
+ - `"file"File`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required BetaManagedAgentsSessionStats Stats`
+
+ Timing statistics for a session.
+
+ - `Double ActiveSeconds`
+
+ Cumulative time in seconds the session spent in running status. Excludes idle time.
+
+ - `Double DurationSeconds`
+
+ Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
+
+ - `required Status Status`
+
+ SessionStatus enum
+
+ - `"rescheduling"Rescheduling`
+
+ - `"running"Running`
+
+ - `"idle"Idle`
+
+ - `"terminated"Terminated`
+
+ - `required string? Title`
+
+ - `required Type Type`
+
+ - `"session"Session`
+
+ - `required DateTimeOffset UpdatedAt`
+
+ A timestamp in RFC 3339 format
+
+ - `required BetaManagedAgentsSessionUsage Usage`
+
+ Cumulative token usage for a session across all turns.
+
+ - `BetaManagedAgentsCacheCreationUsage CacheCreation`
+
+ Prompt-cache creation token usage broken down by cache lifetime.
+
+ - `Int Ephemeral1hInputTokens`
+
+ Tokens used to create 1-hour ephemeral cache entries.
+
+ - `Int Ephemeral5mInputTokens`
+
+ Tokens used to create 5-minute ephemeral cache entries.
+
+ - `Int CacheReadInputTokens`
+
+ Total tokens read from prompt cache.
+
+ - `Int InputTokens`
+
+ Total input tokens consumed across all turns.
+
+ - `Int OutputTokens`
+
+ Total output tokens generated across all turns.
+
+ - `required IReadOnlyList VaultIds`
+
+ Vault IDs attached to the session at creation. Empty when no vaults were supplied.
+
+### Example
+
+```csharp
+SessionRetrieveParams parameters = new()
+{
+ SessionID = "sesn_011CZkZAtmR3yMPDzynEDxu7"
+};
+
+var betaManagedAgentsSession = await client.Beta.Sessions.Retrieve(parameters);
+
+Console.WriteLine(betaManagedAgentsSession);
+```
+
+## Update
+
+`BetaManagedAgentsSession Beta.Sessions.Update(SessionUpdateParamsparameters, CancellationTokencancellationToken = default)`
+
+**post** `/v1/sessions/{session_id}`
+
+Update Session
+
+### Parameters
+
+- `SessionUpdateParams parameters`
+
+ - `required string sessionID`
+
+ Path param: Path parameter session_id
+
+ - `IReadOnlyDictionary? metadata`
+
+ Body param: Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.
+
+ - `string? title`
+
+ Body param: Human-readable session title.
+
+ - `IReadOnlyList vaultIds`
+
+ Body param: Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.
+
+ - `IReadOnlyList