Loading...
    • Developer Guide
    • API Reference
    • MCP
    • Resources
    • Release Notes
    Search...
    ⌘K
    Using the API
    API overviewBeta headersErrors
    Messages
    Create a Message
    Count tokens in a Message
    Models
    List Models
    Get a Model
    Beta
    Admin
    Completions
    Create a Text Completion
    Support & configuration
    Rate limitsService tiersVersionsIP addressesSupported regionsOpenAI SDK compatibility
    Console
    Log in

    Beta

    ModelsExpand Collapse
    AnthropicBeta = String | :"message-batches-2024-09-24" | :"prompt-caching-2024-07-31" | :"computer-use-2024-10-22" | 17 more
    Accepts one of the following:
    String
    :"message-batches-2024-09-24" | :"prompt-caching-2024-07-31" | :"computer-use-2024-10-22" | 17 more
    Accepts one of the following:
    :"message-batches-2024-09-24"
    :"prompt-caching-2024-07-31"
    :"computer-use-2024-10-22"
    :"computer-use-2025-01-24"
    :"pdfs-2024-09-25"
    :"token-counting-2024-11-01"
    :"token-efficient-tools-2025-02-19"
    :"output-128k-2025-02-19"
    :"files-api-2025-04-14"
    :"mcp-client-2025-04-04"
    :"mcp-client-2025-11-20"
    :"dev-full-thinking-2025-05-14"
    :"interleaved-thinking-2025-05-14"
    :"code-execution-2025-05-22"
    :"extended-cache-ttl-2025-04-11"
    :"context-1m-2025-08-07"
    :"context-management-2025-06-27"
    :"model-context-window-exceeded-2025-08-26"
    :"skills-2025-10-02"
    :"fast-mode-2026-02-01"
    class BetaAPIError { message, type }
    message: String
    type: :api_error
    class BetaAuthenticationError { message, type }
    message: String
    type: :authentication_error
    class BetaBillingError { message, type }
    message: String
    type: :billing_error
    BetaError = BetaInvalidRequestError { message, type } | BetaAuthenticationError { message, type } | BetaBillingError { message, type } | 6 more
    Accepts one of the following:
    class BetaInvalidRequestError { message, type }
    message: String
    type: :invalid_request_error
    class BetaAuthenticationError { message, type }
    message: String
    type: :authentication_error
    class BetaBillingError { message, type }
    message: String
    type: :billing_error
    class BetaPermissionError { message, type }
    message: String
    type: :permission_error
    class BetaNotFoundError { message, type }
    message: String
    type: :not_found_error
    class BetaRateLimitError { message, type }
    message: String
    type: :rate_limit_error
    class BetaGatewayTimeoutError { message, type }
    message: String
    type: :timeout_error
    class BetaAPIError { message, type }
    message: String
    type: :api_error
    class BetaOverloadedError { message, type }
    message: String
    type: :overloaded_error
    class BetaErrorResponse { error, request_id, type }
    error: BetaError
    Accepts one of the following:
    class BetaInvalidRequestError { message, type }
    message: String
    type: :invalid_request_error
    class BetaAuthenticationError { message, type }
    message: String
    type: :authentication_error
    class BetaBillingError { message, type }
    message: String
    type: :billing_error
    class BetaPermissionError { message, type }
    message: String
    type: :permission_error
    class BetaNotFoundError { message, type }
    message: String
    type: :not_found_error
    class BetaRateLimitError { message, type }
    message: String
    type: :rate_limit_error
    class BetaGatewayTimeoutError { message, type }
    message: String
    type: :timeout_error
    class BetaAPIError { message, type }
    message: String
    type: :api_error
    class BetaOverloadedError { message, type }
    message: String
    type: :overloaded_error
    request_id: String
    type: :error
    class BetaGatewayTimeoutError { message, type }
    message: String
    type: :timeout_error
    class BetaInvalidRequestError { message, type }
    message: String
    type: :invalid_request_error
    class BetaNotFoundError { message, type }
    message: String
    type: :not_found_error
    class BetaOverloadedError { message, type }
    message: String
    type: :overloaded_error
    class BetaPermissionError { message, type }
    message: String
    type: :permission_error
    class BetaRateLimitError { message, type }
    message: String
    type: :rate_limit_error

    BetaModels

    List Models
    beta.models.list(**kwargs) -> Page<BetaModelInfo { id, created_at, display_name, type } >
    GET/v1/models
    Get a Model
    beta.models.retrieve(model_id, **kwargs) -> BetaModelInfo { id, created_at, display_name, type }
    GET/v1/models/{model_id}
    ModelsExpand Collapse
    class BetaModelInfo { id, created_at, display_name, type }
    id: String

    Unique model identifier.

    created_at: Time

    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.

    type: :model

    Object type.

    For Models, this is always "model".

    BetaMessages

    Create a Message
    beta.messages.create(**kwargs) -> BetaMessage { id, container, content, 7 more }
    POST/v1/messages
    Count tokens in a Message
    beta.messages.count_tokens(**kwargs) -> BetaMessageTokensCount { context_management, input_tokens }
    POST/v1/messages/count_tokens
    ModelsExpand Collapse
    class BetaAllThinkingTurns { type }
    type: :all
    class BetaBase64ImageSource { data, media_type, type }
    data: String
    media_type: :"image/jpeg" | :"image/png" | :"image/gif" | :"image/webp"
    Accepts one of the following:
    :"image/jpeg"
    :"image/png"
    :"image/gif"
    :"image/webp"
    type: :base64
    class BetaBase64PDFSource { data, media_type, type }
    data: String
    media_type: :"application/pdf"
    type: :base64
    class BetaBashCodeExecutionOutputBlock { file_id, type }
    file_id: String
    type: :bash_code_execution_output
    class BetaBashCodeExecutionOutputBlockParam { file_id, type }
    file_id: String
    type: :bash_code_execution_output
    class BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    content: Array[BetaBashCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :bash_code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :bash_code_execution_result
    class BetaBashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
    content: Array[BetaBashCodeExecutionOutputBlockParam { file_id, type } ]
    file_id: String
    type: :bash_code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :bash_code_execution_result
    class BetaBashCodeExecutionToolResultBlock { content, tool_use_id, type }
    content: BetaBashCodeExecutionToolResultError { error_code, type } | BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    Accepts one of the following:
    class BetaBashCodeExecutionToolResultError { error_code, type }
    error_code: :invalid_tool_input | :unavailable | :too_many_requests | 2 more
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    :output_file_too_large
    type: :bash_code_execution_tool_result_error
    class BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    content: Array[BetaBashCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :bash_code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :bash_code_execution_result
    tool_use_id: String
    type: :bash_code_execution_tool_result
    class BetaBashCodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
    content: BetaBashCodeExecutionToolResultErrorParam { error_code, type } | BetaBashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
    Accepts one of the following:
    class BetaBashCodeExecutionToolResultErrorParam { error_code, type }
    error_code: :invalid_tool_input | :unavailable | :too_many_requests | 2 more
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    :output_file_too_large
    type: :bash_code_execution_tool_result_error
    class BetaBashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
    content: Array[BetaBashCodeExecutionOutputBlockParam { file_id, type } ]
    file_id: String
    type: :bash_code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :bash_code_execution_result
    tool_use_id: String
    type: :bash_code_execution_tool_result
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    class BetaBashCodeExecutionToolResultError { error_code, type }
    error_code: :invalid_tool_input | :unavailable | :too_many_requests | 2 more
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    :output_file_too_large
    type: :bash_code_execution_tool_result_error
    class BetaBashCodeExecutionToolResultErrorParam { error_code, type }
    error_code: :invalid_tool_input | :unavailable | :too_many_requests | 2 more
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    :output_file_too_large
    type: :bash_code_execution_tool_result_error
    class BetaCacheControlEphemeral { type, ttl }
    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    class BetaCacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }
    ephemeral_1h_input_tokens: Integer

    The number of input tokens used to create the 1 hour cache entry.

    ephemeral_5m_input_tokens: Integer

    The number of input tokens used to create the 5 minute cache entry.

    class BetaCitationCharLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    file_id: String
    start_char_index: Integer
    type: :char_location
    class BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    start_char_index: Integer
    type: :char_location
    class BetaCitationConfig { enabled }
    enabled: bool
    class BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    file_id: String
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationPageLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    file_id: String
    start_page_number: Integer
    type: :page_location
    class BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    start_page_number: Integer
    type: :page_location
    class BetaCitationSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    class BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    class BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationsConfigParam { enabled }
    enabled: bool
    class BetaCitationsDelta { citation, type }
    citation: BetaCitationCharLocation { cited_text, document_index, document_title, 4 more } | BetaCitationPageLocation { cited_text, document_index, document_title, 4 more } | BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more } | 2 more
    Accepts one of the following:
    class BetaCitationCharLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    file_id: String
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    file_id: String
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    file_id: String
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    type: :citations_delta
    class BetaCitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaClearThinking20251015Edit { type, keep }
    type: :clear_thinking_20251015
    keep: BetaThinkingTurns { type, value } | BetaAllThinkingTurns { type } | :all

    Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.

    Accepts one of the following:
    class BetaThinkingTurns { type, value }
    type: :thinking_turns
    value: Integer
    class BetaAllThinkingTurns { type }
    type: :all
    Keep = :all
    class BetaClearThinking20251015EditResponse { cleared_input_tokens, cleared_thinking_turns, type }
    cleared_input_tokens: Integer

    Number of input tokens cleared by this edit.

    cleared_thinking_turns: Integer

    Number of thinking turns that were cleared.

    type: :clear_thinking_20251015

    The type of context management edit applied.

    class BetaClearToolUses20250919Edit { type, clear_at_least, clear_tool_inputs, 3 more }
    type: :clear_tool_uses_20250919
    clear_at_least: BetaInputTokensClearAtLeast { 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: Integer
    clear_tool_inputs: bool | Array[String]

    Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)

    Accepts one of the following:
    bool
    Array[String]
    exclude_tools: Array[String]

    Tool names whose uses are preserved from clearing

    keep: BetaToolUsesKeep { type, value }

    Number of tool uses to retain in the conversation

    type: :tool_uses
    value: Integer
    trigger: BetaInputTokensTrigger { type, value } | BetaToolUsesTrigger { type, value }

    Condition that triggers the context management strategy

    Accepts one of the following:
    class BetaInputTokensTrigger { type, value }
    type: :input_tokens
    value: Integer
    class BetaToolUsesTrigger { type, value }
    type: :tool_uses
    value: Integer
    class BetaClearToolUses20250919EditResponse { cleared_input_tokens, cleared_tool_uses, type }
    cleared_input_tokens: Integer

    Number of input tokens cleared by this edit.

    cleared_tool_uses: Integer

    Number of tool uses that were cleared.

    type: :clear_tool_uses_20250919

    The type of context management edit applied.

    class BetaCodeExecutionOutputBlock { file_id, type }
    file_id: String
    type: :code_execution_output
    class BetaCodeExecutionOutputBlockParam { file_id, type }
    file_id: String
    type: :code_execution_output
    class BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    content: Array[BetaCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :code_execution_result
    class BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
    content: Array[BetaCodeExecutionOutputBlockParam { file_id, type } ]
    file_id: String
    type: :code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :code_execution_result
    class BetaCodeExecutionTool20250522 { 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: Array[:direct | :code_execution_20250825 | :code_execution_20260120]
    Accepts one of the following:
    :direct
    :code_execution_20250825
    :code_execution_20260120
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    defer_loading: bool

    If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

    strict: bool

    When true, guarantees schema validation on tool names and inputs

    class BetaCodeExecutionTool20250825 { 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: Array[:direct | :code_execution_20250825 | :code_execution_20260120]
    Accepts one of the following:
    :direct
    :code_execution_20250825
    :code_execution_20260120
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    defer_loading: bool

    If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

    strict: bool

    When true, guarantees schema validation on tool names and inputs

    class BetaCodeExecutionTool20260120 { 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: Array[:direct | :code_execution_20250825 | :code_execution_20260120]
    Accepts one of the following:
    :direct
    :code_execution_20250825
    :code_execution_20260120
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    defer_loading: bool

    If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

    strict: bool

    When true, guarantees schema validation on tool names and inputs

    class BetaCodeExecutionToolResultBlock { content, tool_use_id, type }
    content: BetaCodeExecutionToolResultBlockContent

    Code execution result with encrypted stdout for PFC + web_search results.

    Accepts one of the following:
    class BetaCodeExecutionToolResultError { error_code, type }
    error_code: BetaCodeExecutionToolResultErrorCode
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    type: :code_execution_tool_result_error
    class BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    content: Array[BetaCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :code_execution_result
    class BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more }

    Code execution result with encrypted stdout for PFC + web_search results.

    content: Array[BetaCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :code_execution_output
    encrypted_stdout: String
    return_code: Integer
    stderr: String
    type: :encrypted_code_execution_result
    tool_use_id: String
    type: :code_execution_tool_result
    BetaCodeExecutionToolResultBlockContent = BetaCodeExecutionToolResultError { error_code, type } | BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more } | BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more }

    Code execution result with encrypted stdout for PFC + web_search results.

    Accepts one of the following:
    class BetaCodeExecutionToolResultError { error_code, type }
    error_code: BetaCodeExecutionToolResultErrorCode
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    type: :code_execution_tool_result_error
    class BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    content: Array[BetaCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :code_execution_result
    class BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more }

    Code execution result with encrypted stdout for PFC + web_search results.

    content: Array[BetaCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :code_execution_output
    encrypted_stdout: String
    return_code: Integer
    stderr: String
    type: :encrypted_code_execution_result
    class BetaCodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
    content: BetaCodeExecutionToolResultBlockParamContent

    Code execution result with encrypted stdout for PFC + web_search results.

    Accepts one of the following:
    class BetaCodeExecutionToolResultErrorParam { error_code, type }
    error_code: BetaCodeExecutionToolResultErrorCode
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    type: :code_execution_tool_result_error
    class BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
    content: Array[BetaCodeExecutionOutputBlockParam { file_id, type } ]
    file_id: String
    type: :code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :code_execution_result
    class BetaEncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more }

    Code execution result with encrypted stdout for PFC + web_search results.

    content: Array[BetaCodeExecutionOutputBlockParam { file_id, type } ]
    file_id: String
    type: :code_execution_output
    encrypted_stdout: String
    return_code: Integer
    stderr: String
    type: :encrypted_code_execution_result
    tool_use_id: String
    type: :code_execution_tool_result
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    BetaCodeExecutionToolResultBlockParamContent = BetaCodeExecutionToolResultErrorParam { error_code, type } | BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more } | BetaEncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more }

    Code execution result with encrypted stdout for PFC + web_search results.

    Accepts one of the following:
    class BetaCodeExecutionToolResultErrorParam { error_code, type }
    error_code: BetaCodeExecutionToolResultErrorCode
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    type: :code_execution_tool_result_error
    class BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
    content: Array[BetaCodeExecutionOutputBlockParam { file_id, type } ]
    file_id: String
    type: :code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :code_execution_result
    class BetaEncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more }

    Code execution result with encrypted stdout for PFC + web_search results.

    content: Array[BetaCodeExecutionOutputBlockParam { file_id, type } ]
    file_id: String
    type: :code_execution_output
    encrypted_stdout: String
    return_code: Integer
    stderr: String
    type: :encrypted_code_execution_result
    class BetaCodeExecutionToolResultError { error_code, type }
    error_code: BetaCodeExecutionToolResultErrorCode
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    type: :code_execution_tool_result_error
    BetaCodeExecutionToolResultErrorCode = :invalid_tool_input | :unavailable | :too_many_requests | :execution_time_exceeded
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    class BetaCodeExecutionToolResultErrorParam { error_code, type }
    error_code: BetaCodeExecutionToolResultErrorCode
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    type: :code_execution_tool_result_error
    class BetaCompact20260112Edit { type, instructions, pause_after_compaction, trigger }

    Automatically compact older context when reaching the configured trigger threshold.

    type: :compact_20260112
    instructions: String

    Additional instructions for summarization.

    pause_after_compaction: bool

    Whether to pause after compaction and return the compaction block to the user.

    trigger: BetaInputTokensTrigger { type, value }

    When to trigger compaction. Defaults to 150000 input tokens.

    type: :input_tokens
    value: Integer
    class BetaCompactionBlock { 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
    class BetaCompactionBlockParam { 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: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    class BetaCompactionContentBlockDelta { content, type }
    content: String
    type: :compaction_delta
    class BetaCompactionIterationUsage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more }

    Token usage for a compaction iteration.

    cache_creation: BetaCacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }

    Breakdown of cached tokens by TTL

    ephemeral_1h_input_tokens: Integer

    The number of input tokens used to create the 1 hour cache entry.

    ephemeral_5m_input_tokens: Integer

    The number of input tokens used to create the 5 minute cache entry.

    cache_creation_input_tokens: Integer

    The number of input tokens used to create the cache entry.

    cache_read_input_tokens: Integer

    The number of input tokens read from the cache.

    input_tokens: Integer

    The number of input tokens which were used.

    output_tokens: Integer

    The number of output tokens which were used.

    type: :compaction

    Usage for a compaction iteration

    class BetaContainer { 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: Time

    The time at which the container will expire.

    skills: Array[BetaSkill { skill_id, type, version } ]

    Skills loaded in the container

    skill_id: String

    Skill ID

    type: :anthropic | :custom

    Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

    Accepts one of the following:
    :anthropic
    :custom
    version: String

    Skill version or 'latest' for most recent version

    class BetaContainerParams { id, skills }

    Container parameters with skills to be loaded.

    id: String

    Container id

    skills: Array[BetaSkillParams { skill_id, type, version } ]

    List of skills to load in the container

    skill_id: String

    Skill ID

    type: :anthropic | :custom

    Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

    Accepts one of the following:
    :anthropic
    :custom
    version: String

    Skill version or 'latest' for most recent version

    class BetaContainerUploadBlock { file_id, type }

    Response model for a file uploaded to the container.

    file_id: String
    type: :container_upload
    class BetaContainerUploadBlockParam { 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: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    BetaContentBlock = BetaTextBlock { citations, text, type } | BetaThinkingBlock { signature, thinking, type } | BetaRedactedThinkingBlock { data, type } | 12 more

    Response model for a file uploaded to the container.

    Accepts one of the following:
    class BetaTextBlock { citations, text, type }
    citations: Array[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.

    Accepts one of the following:
    class BetaCitationCharLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    file_id: String
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    file_id: String
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    file_id: String
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    text: String
    type: :text
    class BetaThinkingBlock { signature, thinking, type }
    signature: String
    thinking: String
    type: :thinking
    class BetaRedactedThinkingBlock { data, type }
    data: String
    type: :redacted_thinking
    class BetaToolUseBlock { id, input, name, 2 more }
    id: String
    input: Hash[Symbol, untyped]
    name: String
    type: :tool_use
    caller_: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller { type }

    Tool invocation directly from the model.

    type: :direct
    class BetaServerToolCaller { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: String
    type: :code_execution_20250825
    class BetaServerToolCaller20260120 { tool_id, type }
    tool_id: String
    type: :code_execution_20260120
    class BetaServerToolUseBlock { id, input, name, 2 more }
    id: String
    input: Hash[Symbol, untyped]
    name: :web_search | :web_fetch | :code_execution | 4 more
    Accepts one of the following:
    :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_: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller { type }

    Tool invocation directly from the model.

    type: :direct
    class BetaServerToolCaller { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: String
    type: :code_execution_20250825
    class BetaServerToolCaller20260120 { tool_id, type }
    tool_id: String
    type: :code_execution_20260120
    class BetaWebSearchToolResultBlock { content, tool_use_id, type, caller_ }
    content: BetaWebSearchToolResultBlockContent
    Accepts one of the following:
    class BetaWebSearchToolResultError { error_code, type }
    error_code: BetaWebSearchToolResultErrorCode
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :max_uses_exceeded
    :too_many_requests
    :query_too_long
    :request_too_large
    type: :web_search_tool_result_error
    Array[BetaWebSearchResultBlock { encrypted_content, page_age, title, 2 more } ]
    encrypted_content: String
    page_age: String
    title: String
    type: :web_search_result
    url: String
    tool_use_id: String
    type: :web_search_tool_result
    caller_: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller { type }

    Tool invocation directly from the model.

    type: :direct
    class BetaServerToolCaller { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: String
    type: :code_execution_20250825
    class BetaServerToolCaller20260120 { tool_id, type }
    tool_id: String
    type: :code_execution_20260120
    class BetaWebFetchToolResultBlock { content, tool_use_id, type, caller_ }
    content: BetaWebFetchToolResultErrorBlock { error_code, type } | BetaWebFetchBlock { content, retrieved_at, type, url }
    Accepts one of the following:
    class BetaWebFetchToolResultErrorBlock { error_code, type }
    error_code: BetaWebFetchToolResultErrorCode
    Accepts one of the following:
    :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
    class BetaWebFetchBlock { content, retrieved_at, type, url }
    content: BetaDocumentBlock { citations, source, title, type }
    citations: BetaCitationConfig { enabled }

    Citation configuration for the document

    enabled: bool
    source: BetaBase64PDFSource { data, media_type, type } | BetaPlainTextSource { data, media_type, type }
    Accepts one of the following:
    class BetaBase64PDFSource { data, media_type, type }
    data: String
    media_type: :"application/pdf"
    type: :base64
    class BetaPlainTextSource { 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_: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller { type }

    Tool invocation directly from the model.

    type: :direct
    class BetaServerToolCaller { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: String
    type: :code_execution_20250825
    class BetaServerToolCaller20260120 { tool_id, type }
    tool_id: String
    type: :code_execution_20260120
    class BetaCodeExecutionToolResultBlock { content, tool_use_id, type }
    content: BetaCodeExecutionToolResultBlockContent

    Code execution result with encrypted stdout for PFC + web_search results.

    Accepts one of the following:
    class BetaCodeExecutionToolResultError { error_code, type }
    error_code: BetaCodeExecutionToolResultErrorCode
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    type: :code_execution_tool_result_error
    class BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    content: Array[BetaCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :code_execution_result
    class BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more }

    Code execution result with encrypted stdout for PFC + web_search results.

    content: Array[BetaCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :code_execution_output
    encrypted_stdout: String
    return_code: Integer
    stderr: String
    type: :encrypted_code_execution_result
    tool_use_id: String
    type: :code_execution_tool_result
    class BetaBashCodeExecutionToolResultBlock { content, tool_use_id, type }
    content: BetaBashCodeExecutionToolResultError { error_code, type } | BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    Accepts one of the following:
    class BetaBashCodeExecutionToolResultError { error_code, type }
    error_code: :invalid_tool_input | :unavailable | :too_many_requests | 2 more
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    :output_file_too_large
    type: :bash_code_execution_tool_result_error
    class BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    content: Array[BetaBashCodeExecutionOutputBlock { file_id, type } ]
    file_id: String
    type: :bash_code_execution_output
    return_code: Integer
    stderr: String
    stdout: String
    type: :bash_code_execution_result
    tool_use_id: String
    type: :bash_code_execution_tool_result
    class BetaTextEditorCodeExecutionToolResultBlock { content, tool_use_id, type }
    content: BetaTextEditorCodeExecutionToolResultError { error_code, error_message, type } | BetaTextEditorCodeExecutionViewResultBlock { content, file_type, num_lines, 3 more } | BetaTextEditorCodeExecutionCreateResultBlock { is_file_update, type } | BetaTextEditorCodeExecutionStrReplaceResultBlock { lines, new_lines, new_start, 3 more }
    Accepts one of the following:
    class BetaTextEditorCodeExecutionToolResultError { error_code, error_message, type }
    error_code: :invalid_tool_input | :unavailable | :too_many_requests | 2 more
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    :file_not_found
    error_message: String
    type: :text_editor_code_execution_tool_result_error
    class BetaTextEditorCodeExecutionViewResultBlock { content, file_type, num_lines, 3 more }
    content: String
    file_type: :text | :image | :pdf
    Accepts one of the following:
    :text
    :image
    :pdf
    num_lines: Integer
    start_line: Integer
    total_lines: Integer
    type: :text_editor_code_execution_view_result
    class BetaTextEditorCodeExecutionCreateResultBlock { is_file_update, type }
    is_file_update: bool
    type: :text_editor_code_execution_create_result
    class BetaTextEditorCodeExecutionStrReplaceResultBlock { lines, new_lines, new_start, 3 more }
    lines: Array[String]
    new_lines: Integer
    new_start: Integer
    old_lines: Integer
    old_start: Integer
    type: :text_editor_code_execution_str_replace_result
    tool_use_id: String
    type: :text_editor_code_execution_tool_result
    class BetaToolSearchToolResultBlock { content, tool_use_id, type }
    content: BetaToolSearchToolResultError { error_code, error_message, type } | BetaToolSearchToolSearchResultBlock { tool_references, type }
    Accepts one of the following:
    class BetaToolSearchToolResultError { error_code, error_message, type }
    error_code: :invalid_tool_input | :unavailable | :too_many_requests | :execution_time_exceeded
    Accepts one of the following:
    :invalid_tool_input
    :unavailable
    :too_many_requests
    :execution_time_exceeded
    error_message: String
    type: :tool_search_tool_result_error
    class BetaToolSearchToolSearchResultBlock { tool_references, type }
    tool_references: Array[BetaToolReferenceBlock { tool_name, type } ]
    tool_name: String
    type: :tool_reference
    type: :tool_search_tool_search_result
    tool_use_id: String
    type: :tool_search_tool_result
    class BetaMCPToolUseBlock { id, input, name, 2 more }
    id: String
    input: Hash[Symbol, untyped]
    name: String

    The name of the MCP tool

    server_name: String

    The name of the MCP server

    type: :mcp_tool_use
    class BetaMCPToolResultBlock { content, is_error, tool_use_id, type }
    content: String | Array[BetaTextBlock { citations, text, type } ]
    Accepts one of the following:
    String
    Array[BetaTextBlock { citations, text, type } ]
    citations: Array[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.

    Accepts one of the following:
    class BetaCitationCharLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    file_id: String
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    file_id: String
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    file_id: String
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    text: String
    type: :text
    is_error: bool
    tool_use_id: String
    type: :mcp_tool_result
    class BetaContainerUploadBlock { file_id, type }

    Response model for a file uploaded to the container.

    file_id: String
    type: :container_upload
    class BetaCompactionBlock { 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
    BetaContentBlockParam = BetaTextBlockParam { text, type, cache_control, citations } | BetaImageBlockParam { source, type, cache_control } | BetaRequestDocumentBlock { source, type, cache_control, 3 more } | 16 more

    Regular text content.

    Accepts one of the following:
    class BetaTextBlockParam { text, type, cache_control, citations }
    text: String
    type: :text
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: Array[BetaTextCitationParam]
    Accepts one of the following:
    class BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    class BetaImageBlockParam { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
    Accepts one of the following:
    class BetaBase64ImageSource { data, media_type, type }
    data: String
    media_type: :"image/jpeg" | :"image/png" | :"image/gif" | :"image/webp"
    Accepts one of the following:
    :"image/jpeg"
    :"image/png"
    :"image/gif"
    :"image/webp"
    type: :base64
    class BetaURLImageSource { type, url }
    type: :url
    url: String
    class BetaFileImageSource { file_id, type }
    file_id: String
    type: :file
    type: :image
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    class BetaRequestDocumentBlock { source, type, cache_control, 3 more }
    source: BetaBase64PDFSource { data, media_type, type } | BetaPlainTextSource { data, media_type, type } | BetaContentBlockSource { content, type } | 2 more
    Accepts one of the following:
    class BetaBase64PDFSource { data, media_type, type }
    data: String
    media_type: :"application/pdf"
    type: :base64
    class BetaPlainTextSource { data, media_type, type }
    data: String
    media_type: :"text/plain"
    type: :text
    class BetaContentBlockSource { content, type }
    content: String | Array[BetaContentBlockSourceContent]
    Accepts one of the following:
    String
    Array[BetaContentBlockSourceContent]
    Accepts one of the following:
    class BetaTextBlockParam { text, type, cache_control, citations }
    text: String
    type: :text
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: Array[BetaTextCitationParam]
    Accepts one of the following:
    class BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    class BetaImageBlockParam { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
    Accepts one of the following:
    class BetaBase64ImageSource { data, media_type, type }
    data: String
    media_type: :"image/jpeg" | :"image/png" | :"image/gif" | :"image/webp"
    Accepts one of the following:
    :"image/jpeg"
    :"image/png"
    :"image/gif"
    :"image/webp"
    type: :base64
    class BetaURLImageSource { type, url }
    type: :url
    url: String
    class BetaFileImageSource { file_id, type }
    file_id: String
    type: :file
    type: :image
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    type: :content
    class BetaURLPDFSource { type, url }
    type: :url
    url: String
    class BetaFileDocumentSource { file_id, type }
    file_id: String
    type: :file
    type: :document
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: BetaCitationsConfigParam { enabled }
    enabled: bool
    context: String
    title: String
    class BetaSearchResultBlockParam { content, source, title, 3 more }
    content: Array[BetaTextBlockParam { text, type, cache_control, citations } ]
    text: String
    type: :text
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: Array[BetaTextCitationParam]
    Accepts one of the following:
    class BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    source: String
    title: String
    type: :search_result
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: BetaCitationsConfigParam { enabled }
    enabled: bool
    class BetaThinkingBlockParam { signature, thinking, type }
    signature: String
    thinking: String
    type: :thinking
    class BetaRedactedThinkingBlockParam { data, type }
    data: String
    type: :redacted_thinking
    class BetaToolUseBlockParam { id, input, name, 3 more }
    id: String
    input: Hash[Symbol, untyped]
    name: String
    type: :tool_use
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    caller_: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller { type }

    Tool invocation directly from the model.

    type: :direct
    class BetaServerToolCaller { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: String
    type: :code_execution_20250825
    class BetaServerToolCaller20260120 { tool_id, type }
    tool_id: String
    type: :code_execution_20260120
    class BetaToolResultBlockParam { tool_use_id, type, cache_control, 2 more }
    tool_use_id: String
    type: :tool_result
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    content: String | Array[BetaTextBlockParam { text, type, cache_control, citations } | BetaImageBlockParam { source, type, cache_control } | BetaSearchResultBlockParam { content, source, title, 3 more } | 2 more]
    Accepts one of the following:
    String
    Array[BetaTextBlockParam { text, type, cache_control, citations } | BetaImageBlockParam { source, type, cache_control } | BetaSearchResultBlockParam { content, source, title, 3 more } | 2 more]
    Accepts one of the following:
    class BetaTextBlockParam { text, type, cache_control, citations }
    text: String
    type: :text
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: Array[BetaTextCitationParam]
    Accepts one of the following:
    class BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    class BetaImageBlockParam { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
    Accepts one of the following:
    class BetaBase64ImageSource { data, media_type, type }
    data: String
    media_type: :"image/jpeg" | :"image/png" | :"image/gif" | :"image/webp"
    Accepts one of the following:
    :"image/jpeg"
    :"image/png"
    :"image/gif"
    :"image/webp"
    type: :base64
    class BetaURLImageSource { type, url }
    type: :url
    url: String
    class BetaFileImageSource { file_id, type }
    file_id: String
    type: :file
    type: :image
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    class BetaSearchResultBlockParam { content, source, title, 3 more }
    content: Array[BetaTextBlockParam { text, type, cache_control, citations } ]
    text: String
    type: :text
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: Array[BetaTextCitationParam]
    Accepts one of the following:
    class BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    source: String
    title: String
    type: :search_result
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: BetaCitationsConfigParam { enabled }
    enabled: bool
    class BetaRequestDocumentBlock { source, type, cache_control, 3 more }
    source: BetaBase64PDFSource { data, media_type, type } | BetaPlainTextSource { data, media_type, type } | BetaContentBlockSource { content, type } | 2 more
    Accepts one of the following:
    class BetaBase64PDFSource { data, media_type, type }
    data: String
    media_type: :"application/pdf"
    type: :base64
    class BetaPlainTextSource { data, media_type, type }
    data: String
    media_type: :"text/plain"
    type: :text
    class BetaContentBlockSource { content, type }
    content: String | Array[BetaContentBlockSourceContent]
    Accepts one of the following:
    String
    Array[BetaContentBlockSourceContent]
    Accepts one of the following:
    class BetaTextBlockParam { text, type, cache_control, citations }
    text: String
    type: :text
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: Array[BetaTextCitationParam]
    Accepts one of the following:
    class BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    class BetaImageBlockParam { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
    Accepts one of the following:
    class BetaBase64ImageSource { data, media_type, type }
    data: String
    media_type: :"image/jpeg" | :"image/png" | :"image/gif" | :"image/webp"
    Accepts one of the following:
    :"image/jpeg"
    :"image/png"
    :"image/gif"
    :"image/webp"
    type: :base64
    class BetaURLImageSource { type, url }
    type: :url
    url: String
    class BetaFileImageSource { file_id, type }
    file_id: String
    type: :file
    type: :image
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    type: :content
    class BetaURLPDFSource { type, url }
    type: :url
    url: String
    class BetaFileDocumentSource { file_id, type }
    file_id: String
    type: :file
    type: :document
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: BetaCitationsConfigParam { enabled }
    enabled: bool
    context: String
    title: String
    class BetaToolReferenceBlockParam { tool_name, type, cache_control }

    Tool reference block that can be included in tool_result content.

    tool_name: String
    type: :tool_reference
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    is_error: bool
    class BetaServerToolUseBlockParam { id, input, name, 3 more }
    id: String
    input: Hash[Symbol, untyped]
    name: :web_search | :web_fetch | :code_execution | 4 more
    Accepts one of the following:
    :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: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    caller_: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller { type }

    Tool invocation directly from the model.

    type: :direct
    class BetaServerToolCaller { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: String
    type: :code_execution_20250825
    class BetaServerToolCaller20260120 { tool_id, type }
    tool_id: String
    type: :code_execution_20260120
    class BetaWebSearchToolResultBlockParam { content, tool_use_id, type, 2 more }
    content: BetaWebSearchToolResultBlockParamContent
    Accepts one of the following:
    Array[BetaWebSearchResultBlockParam { encrypted_content, title, type, 2 more } ]
    encrypted_content: String
    title: String
    type: :web_search_result
    url: String
    page_age: String
    class BetaWebSearchToolRequestError { error_code, type }
    error_code: BetaWebSearchToolResultErrorCode
    Accepts one of the following:
    :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: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    caller_: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller { type }

    Tool invocation directly from the model.

    type: :direct
    class BetaServerToolCaller { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: String
    type: :code_execution_20250825
    class BetaServerToolCaller20260120 { tool_id, type }
    tool_id: String
    type: :code_execution_20260120
    class BetaWebFetchToolResultBlockParam { content, tool_use_id, type, 2 more }
    content: BetaWebFetchToolResultErrorBlockParam { error_code, type } | BetaWebFetchBlockParam { content, type, url, retrieved_at }
    Accepts one of the following:
    class BetaWebFetchToolResultErrorBlockParam { error_code, type }
    error_code: BetaWebFetchToolResultErrorCode
    Accepts one of the following:
    :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
    class BetaWebFetchBlockParam { content, type, url, retrieved_at }
    content: BetaRequestDocumentBlock { source, type, cache_control, 3 more }
    source: BetaBase64PDFSource { data, media_type, type } | BetaPlainTextSource { data, media_type, type } | BetaContentBlockSource { content, type } | 2 more
    Accepts one of the following:
    class BetaBase64PDFSource { data, media_type, type }
    data: String
    media_type: :"application/pdf"
    type: :base64
    class BetaPlainTextSource { data, media_type, type }
    data: String
    media_type: :"text/plain"
    type: :text
    class BetaContentBlockSource { content, type }
    content: String | Array[BetaContentBlockSourceContent]
    Accepts one of the following:
    String
    Array[BetaContentBlockSourceContent]
    Accepts one of the following:
    class BetaTextBlockParam { text, type, cache_control, citations }
    text: String
    type: :text
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: Array[BetaTextCitationParam]
    Accepts one of the following:
    class BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_char_index: Integer
    start_char_index: Integer
    type: :char_location
    class BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_page_number: Integer
    start_page_number: Integer
    type: :page_location
    class BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
    cited_text: String
    document_index: Integer
    document_title: String
    end_block_index: Integer
    start_block_index: Integer
    type: :content_block_location
    class BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
    cited_text: String
    encrypted_index: String
    title: String
    type: :web_search_result_location
    url: String
    class BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
    cited_text: String
    end_block_index: Integer
    search_result_index: Integer
    source: String
    start_block_index: Integer
    title: String
    type: :search_result_location
    class BetaImageBlockParam { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
    Accepts one of the following:
    class BetaBase64ImageSource { data, media_type, type }
    data: String
    media_type: :"image/jpeg" | :"image/png" | :"image/gif" | :"image/webp"
    Accepts one of the following:
    :"image/jpeg"
    :"image/png"
    :"image/gif"
    :"image/webp"
    type: :base64
    class BetaURLImageSource { type, url }
    type: :url
    url: String
    class BetaFileImageSource { file_id, type }
    file_id: String
    type: :file
    type: :image
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    type: :content
    class BetaURLPDFSource { type, url }
    type: :url
    url: String
    class BetaFileDocumentSource { file_id, type }
    file_id: String
    type: :file
    type: :document
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    citations: BetaCitationsConfigParam { enabled }
    enabled: bool
    context: String
    title: String
    type: :web_fetch_result
    url: String

    Fetched content URL

    retrieved_at: String

    ISO 8601 timestamp when the content was retrieved

    tool_use_id: String
    type: :web_fetch_tool_result
    cache_control: BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: :ephemeral
    ttl: :"5m" | :"1h"

    The time-to-live for the cache control breakpoint.

    This may be one the following values:

    • 5m: 5 minutes
    • 1h: 1 hour

    Defaults to 5m.

    Accepts one of the following:
    :"5m"
    :"1h"
    caller_: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller { type }

    Tool invocation directly from the model.

    type: :direct