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
    Create a Message
    Count tokens in a Message
    Admin
    Completions
    Create a Text Completion
    Support & configuration
    Rate limitsService tiersVersionsIP addressesSupported regionsOpenAI SDK compatibility
    Console
    Log in

    Messages

    Create a Message
    POST/v1/messages
    Count tokens in a Message
    POST/v1/messages/count_tokens
    ModelsExpand Collapse
    BetaAllThinkingTurns = object { type }
    type: "all"
    BetaBase64ImageSource = object { data, media_type, type }
    data: string
    media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"
    Accepts one of the following:
    "image/jpeg"
    "image/png"
    "image/gif"
    "image/webp"
    type: "base64"
    BetaBase64PDFSource = object { data, media_type, type }
    data: string
    media_type: "application/pdf"
    type: "base64"
    BetaBashCodeExecutionOutputBlock = object { file_id, type }
    file_id: string
    type: "bash_code_execution_output"
    BetaBashCodeExecutionOutputBlockParam = object { file_id, type }
    file_id: string
    type: "bash_code_execution_output"
    BetaBashCodeExecutionResultBlock = object { content, return_code, stderr, 2 more }
    content: array of BetaBashCodeExecutionOutputBlock { file_id, type }
    file_id: string
    type: "bash_code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "bash_code_execution_result"
    BetaBashCodeExecutionResultBlockParam = object { content, return_code, stderr, 2 more }
    content: array of BetaBashCodeExecutionOutputBlockParam { file_id, type }
    file_id: string
    type: "bash_code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "bash_code_execution_result"
    BetaBashCodeExecutionToolResultBlock = object { content, tool_use_id, type }
    content: BetaBashCodeExecutionToolResultError { error_code, type } or BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    Accepts one of the following:
    BetaBashCodeExecutionToolResultError = object { error_code, type }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 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"
    BetaBashCodeExecutionResultBlock = object { content, return_code, stderr, 2 more }
    content: array of BetaBashCodeExecutionOutputBlock { file_id, type }
    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"
    BetaBashCodeExecutionToolResultBlockParam = object { content, tool_use_id, type, cache_control }
    content: BetaBashCodeExecutionToolResultErrorParam { error_code, type } or BetaBashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
    Accepts one of the following:
    BetaBashCodeExecutionToolResultErrorParam = object { error_code, type }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 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"
    BetaBashCodeExecutionResultBlockParam = object { content, return_code, stderr, 2 more }
    content: array of BetaBashCodeExecutionOutputBlockParam { file_id, type }
    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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaBashCodeExecutionToolResultError = object { error_code, type }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 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"
    BetaBashCodeExecutionToolResultErrorParam = object { error_code, type }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 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"
    BetaCacheControlEphemeral = 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.

    Accepts one of the following:
    "5m"
    "1h"
    BetaCacheCreation = 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.

    BetaCitationCharLocation = 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"
    BetaCitationCharLocationParam = 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"
    BetaCitationConfig = object { enabled }
    enabled: boolean
    BetaCitationContentBlockLocation = 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"
    BetaCitationContentBlockLocationParam = 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"
    BetaCitationPageLocation = 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"
    BetaCitationPageLocationParam = 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"
    BetaCitationSearchResultLocation = 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"
    BetaCitationSearchResultLocationParam = 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"
    BetaCitationWebSearchResultLocationParam = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationsConfigParam = object { enabled }
    enabled: optional boolean
    BetaCitationsDelta = object { citation, type }
    citation: BetaCitationCharLocation { cited_text, document_index, document_title, 4 more } or BetaCitationPageLocation { cited_text, document_index, document_title, 4 more } or BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more } or 2 more
    Accepts one of the following:
    BetaCitationCharLocation = 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"
    BetaCitationPageLocation = 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"
    BetaCitationContentBlockLocation = 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"
    BetaCitationsWebSearchResultLocation = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocation = 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"
    BetaCitationsWebSearchResultLocation = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaClearThinking20251015Edit = object { type, keep }
    type: "clear_thinking_20251015"
    keep: optional BetaThinkingTurns { type, value } or BetaAllThinkingTurns { type } or "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:
    BetaThinkingTurns = object { type, value }
    type: "thinking_turns"
    value: number
    BetaAllThinkingTurns = object { type }
    type: "all"
    UnionMember2 = "all"
    BetaClearThinking20251015EditResponse = 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.

    BetaClearToolUses20250919Edit = object { type, clear_at_least, clear_tool_inputs, 3 more }
    type: "clear_tool_uses_20250919"
    clear_at_least: optional 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: number
    clear_tool_inputs: optional boolean or array of string

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

    Accepts one of the following:
    UnionMember0 = boolean
    UnionMember1 = array of string
    exclude_tools: optional array of string

    Tool names whose uses are preserved from clearing

    keep: optional BetaToolUsesKeep { type, value }

    Number of tool uses to retain in the conversation

    type: "tool_uses"
    value: number
    trigger: optional BetaInputTokensTrigger { type, value } or BetaToolUsesTrigger { type, value }

    Condition that triggers the context management strategy

    Accepts one of the following:
    BetaInputTokensTrigger = object { type, value }
    type: "input_tokens"
    value: number
    BetaToolUsesTrigger = object { type, value }
    type: "tool_uses"
    value: number
    BetaClearToolUses20250919EditResponse = 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.

    BetaCodeExecutionOutputBlock = object { file_id, type }
    file_id: string
    type: "code_execution_output"
    BetaCodeExecutionOutputBlockParam = object { file_id, type }
    file_id: string
    type: "code_execution_output"
    BetaCodeExecutionResultBlock = object { content, return_code, stderr, 2 more }
    content: array of BetaCodeExecutionOutputBlock { file_id, type }
    file_id: string
    type: "code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "code_execution_result"
    BetaCodeExecutionResultBlockParam = object { content, return_code, stderr, 2 more }
    content: array of BetaCodeExecutionOutputBlockParam { file_id, type }
    file_id: string
    type: "code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "code_execution_result"
    BetaCodeExecutionTool20250522 = 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"
    Accepts one of the following:
    "direct"
    "code_execution_20250825"
    "code_execution_20260120"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: 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

    BetaCodeExecutionTool20250825 = 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"
    Accepts one of the following:
    "direct"
    "code_execution_20250825"
    "code_execution_20260120"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: 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

    BetaCodeExecutionTool20260120 = 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"
    Accepts one of the following:
    "direct"
    "code_execution_20250825"
    "code_execution_20260120"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: 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

    BetaCodeExecutionToolResultBlock = object { content, tool_use_id, type }
    content: BetaCodeExecutionToolResultBlockContent

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

    Accepts one of the following:
    BetaCodeExecutionToolResultError = object { 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"
    BetaCodeExecutionResultBlock = object { content, return_code, stderr, 2 more }
    content: array of BetaCodeExecutionOutputBlock { file_id, type }
    file_id: string
    type: "code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "code_execution_result"
    BetaEncryptedCodeExecutionResultBlock = 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, type }
    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"
    BetaCodeExecutionToolResultBlockContent = BetaCodeExecutionToolResultError { error_code, type } or BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more } or BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more }

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

    Accepts one of the following:
    BetaCodeExecutionToolResultError = object { 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"
    BetaCodeExecutionResultBlock = object { content, return_code, stderr, 2 more }
    content: array of BetaCodeExecutionOutputBlock { file_id, type }
    file_id: string
    type: "code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "code_execution_result"
    BetaEncryptedCodeExecutionResultBlock = 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, type }
    file_id: string
    type: "code_execution_output"
    encrypted_stdout: string
    return_code: number
    stderr: string
    type: "encrypted_code_execution_result"
    BetaCodeExecutionToolResultBlockParam = object { 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:
    BetaCodeExecutionToolResultErrorParam = object { 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"
    BetaCodeExecutionResultBlockParam = object { content, return_code, stderr, 2 more }
    content: array of BetaCodeExecutionOutputBlockParam { file_id, type }
    file_id: string
    type: "code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "code_execution_result"
    BetaEncryptedCodeExecutionResultBlockParam = 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, type }
    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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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 } or BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more } or BetaEncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more }

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

    Accepts one of the following:
    BetaCodeExecutionToolResultErrorParam = object { 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"
    BetaCodeExecutionResultBlockParam = object { content, return_code, stderr, 2 more }
    content: array of BetaCodeExecutionOutputBlockParam { file_id, type }
    file_id: string
    type: "code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "code_execution_result"
    BetaEncryptedCodeExecutionResultBlockParam = 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, type }
    file_id: string
    type: "code_execution_output"
    encrypted_stdout: string
    return_code: number
    stderr: string
    type: "encrypted_code_execution_result"
    BetaCodeExecutionToolResultError = object { 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" or "unavailable" or "too_many_requests" or "execution_time_exceeded"
    Accepts one of the following:
    "invalid_tool_input"
    "unavailable"
    "too_many_requests"
    "execution_time_exceeded"
    BetaCodeExecutionToolResultErrorParam = object { 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"
    BetaCompact20260112Edit = 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 BetaInputTokensTrigger { type, value }

    When to trigger compaction. Defaults to 150000 input tokens.

    type: "input_tokens"
    value: number
    BetaCompactionBlock = 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"
    BetaCompactionBlockParam = 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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaCompactionContentBlockDelta = object { content, type }
    content: string
    type: "compaction_delta"
    BetaCompactionIterationUsage = object { 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: 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

    BetaContainer = 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 { skill_id, type, version }

    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)

    Accepts one of the following:
    "anthropic"
    "custom"
    version: string

    Skill version or 'latest' for most recent version

    BetaContainerParams = object { id, skills }

    Container parameters with skills to be loaded.

    id: optional string

    Container id

    skills: optional array of BetaSkillParams { skill_id, type, version }

    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)

    Accepts one of the following:
    "anthropic"
    "custom"
    version: optional string

    Skill version or 'latest' for most recent version

    BetaContainerUploadBlock = object { file_id, type }

    Response model for a file uploaded to the container.

    file_id: string
    type: "container_upload"
    BetaContainerUploadBlockParam = 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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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 } or BetaThinkingBlock { signature, thinking, type } or BetaRedactedThinkingBlock { data, type } or 12 more

    Response model for a file uploaded to the container.

    Accepts one of the following:
    BetaTextBlock = 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.

    Accepts one of the following:
    BetaCitationCharLocation = 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"
    BetaCitationPageLocation = 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"
    BetaCitationContentBlockLocation = 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"
    BetaCitationsWebSearchResultLocation = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocation = 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"
    BetaThinkingBlock = object { signature, thinking, type }
    signature: string
    thinking: string
    type: "thinking"
    BetaRedactedThinkingBlock = object { data, type }
    data: string
    type: "redacted_thinking"
    BetaToolUseBlock = object { id, input, name, 2 more }
    id: string
    input: map[unknown]
    name: string
    type: "tool_use"
    caller: optional BetaDirectCaller { type } or BetaServerToolCaller { tool_id, type } or BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    BetaDirectCaller = object { type }

    Tool invocation directly from the model.

    type: "direct"
    BetaServerToolCaller = object { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: string
    type: "code_execution_20250825"
    BetaServerToolCaller20260120 = object { tool_id, type }
    tool_id: string
    type: "code_execution_20260120"
    BetaServerToolUseBlock = object { id, input, name, 2 more }
    id: string
    input: map[unknown]
    name: "web_search" or "web_fetch" or "code_execution" or 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: optional BetaDirectCaller { type } or BetaServerToolCaller { tool_id, type } or BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    BetaDirectCaller = object { type }

    Tool invocation directly from the model.

    type: "direct"
    BetaServerToolCaller = object { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: string
    type: "code_execution_20250825"
    BetaServerToolCaller20260120 = object { tool_id, type }
    tool_id: string
    type: "code_execution_20260120"
    BetaWebSearchToolResultBlock = object { content, tool_use_id, type, caller }
    content: BetaWebSearchToolResultBlockContent
    Accepts one of the following:
    BetaWebSearchToolResultError = object { 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"
    UnionMember1 = array of 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: optional BetaDirectCaller { type } or BetaServerToolCaller { tool_id, type } or BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    BetaDirectCaller = object { type }

    Tool invocation directly from the model.

    type: "direct"
    BetaServerToolCaller = object { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: string
    type: "code_execution_20250825"
    BetaServerToolCaller20260120 = object { tool_id, type }
    tool_id: string
    type: "code_execution_20260120"
    BetaWebFetchToolResultBlock = object { content, tool_use_id, type, caller }
    content: BetaWebFetchToolResultErrorBlock { error_code, type } or BetaWebFetchBlock { content, retrieved_at, type, url }
    Accepts one of the following:
    BetaWebFetchToolResultErrorBlock = object { 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"
    BetaWebFetchBlock = object { content, retrieved_at, type, url }
    content: BetaDocumentBlock { citations, source, title, type }
    citations: BetaCitationConfig { enabled }

    Citation configuration for the document

    enabled: boolean
    source: BetaBase64PDFSource { data, media_type, type } or BetaPlainTextSource { data, media_type, type }
    Accepts one of the following:
    BetaBase64PDFSource = object { data, media_type, type }
    data: string
    media_type: "application/pdf"
    type: "base64"
    BetaPlainTextSource = 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 { type } or BetaServerToolCaller { tool_id, type } or BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    BetaDirectCaller = object { type }

    Tool invocation directly from the model.

    type: "direct"
    BetaServerToolCaller = object { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: string
    type: "code_execution_20250825"
    BetaServerToolCaller20260120 = object { tool_id, type }
    tool_id: string
    type: "code_execution_20260120"
    BetaCodeExecutionToolResultBlock = object { content, tool_use_id, type }
    content: BetaCodeExecutionToolResultBlockContent

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

    Accepts one of the following:
    BetaCodeExecutionToolResultError = object { 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"
    BetaCodeExecutionResultBlock = object { content, return_code, stderr, 2 more }
    content: array of BetaCodeExecutionOutputBlock { file_id, type }
    file_id: string
    type: "code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "code_execution_result"
    BetaEncryptedCodeExecutionResultBlock = 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, type }
    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"
    BetaBashCodeExecutionToolResultBlock = object { content, tool_use_id, type }
    content: BetaBashCodeExecutionToolResultError { error_code, type } or BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
    Accepts one of the following:
    BetaBashCodeExecutionToolResultError = object { error_code, type }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 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"
    BetaBashCodeExecutionResultBlock = object { content, return_code, stderr, 2 more }
    content: array of BetaBashCodeExecutionOutputBlock { file_id, type }
    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"
    BetaTextEditorCodeExecutionToolResultBlock = object { content, tool_use_id, type }
    content: BetaTextEditorCodeExecutionToolResultError { error_code, error_message, type } or BetaTextEditorCodeExecutionViewResultBlock { content, file_type, num_lines, 3 more } or BetaTextEditorCodeExecutionCreateResultBlock { is_file_update, type } or BetaTextEditorCodeExecutionStrReplaceResultBlock { lines, new_lines, new_start, 3 more }
    Accepts one of the following:
    BetaTextEditorCodeExecutionToolResultError = object { error_code, error_message, type }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 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"
    BetaTextEditorCodeExecutionViewResultBlock = object { content, file_type, num_lines, 3 more }
    content: string
    file_type: "text" or "image" or "pdf"
    Accepts one of the following:
    "text"
    "image"
    "pdf"
    num_lines: number
    start_line: number
    total_lines: number
    type: "text_editor_code_execution_view_result"
    BetaTextEditorCodeExecutionCreateResultBlock = object { is_file_update, type }
    is_file_update: boolean
    type: "text_editor_code_execution_create_result"
    BetaTextEditorCodeExecutionStrReplaceResultBlock = 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"
    BetaToolSearchToolResultBlock = object { content, tool_use_id, type }
    content: BetaToolSearchToolResultError { error_code, error_message, type } or BetaToolSearchToolSearchResultBlock { tool_references, type }
    Accepts one of the following:
    BetaToolSearchToolResultError = object { error_code, error_message, type }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "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"
    BetaToolSearchToolSearchResultBlock = object { tool_references, type }
    tool_references: array of 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"
    BetaMCPToolUseBlock = 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"
    BetaMCPToolResultBlock = object { content, is_error, tool_use_id, type }
    content: string or array of BetaTextBlock { citations, text, type }
    Accepts one of the following:
    UnionMember0 = string
    BetaMCPToolResultBlockContent = array of BetaTextBlock { 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.

    Accepts one of the following:
    BetaCitationCharLocation = 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"
    BetaCitationPageLocation = 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"
    BetaCitationContentBlockLocation = 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"
    BetaCitationsWebSearchResultLocation = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocation = 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"
    BetaContainerUploadBlock = object { file_id, type }

    Response model for a file uploaded to the container.

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

    Regular text content.

    Accepts one of the following:
    BetaTextBlockParam = object { text, type, cache_control, citations }
    text: string
    type: "text"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional array of BetaTextCitationParam
    Accepts one of the following:
    BetaCitationCharLocationParam = 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"
    BetaCitationPageLocationParam = 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"
    BetaCitationContentBlockLocationParam = 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"
    BetaCitationWebSearchResultLocationParam = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocationParam = 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"
    BetaImageBlockParam = object { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } or BetaURLImageSource { type, url } or BetaFileImageSource { file_id, type }
    Accepts one of the following:
    BetaBase64ImageSource = object { data, media_type, type }
    data: string
    media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"
    Accepts one of the following:
    "image/jpeg"
    "image/png"
    "image/gif"
    "image/webp"
    type: "base64"
    BetaURLImageSource = object { type, url }
    type: "url"
    url: string
    BetaFileImageSource = object { file_id, type }
    file_id: string
    type: "file"
    type: "image"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaRequestDocumentBlock = object { source, type, cache_control, 3 more }
    source: BetaBase64PDFSource { data, media_type, type } or BetaPlainTextSource { data, media_type, type } or BetaContentBlockSource { content, type } or 2 more
    Accepts one of the following:
    BetaBase64PDFSource = object { data, media_type, type }
    data: string
    media_type: "application/pdf"
    type: "base64"
    BetaPlainTextSource = object { data, media_type, type }
    data: string
    media_type: "text/plain"
    type: "text"
    BetaContentBlockSource = object { content, type }
    content: string or array of BetaContentBlockSourceContent
    Accepts one of the following:
    UnionMember0 = string
    BetaContentBlockSourceContent = array of BetaContentBlockSourceContent
    Accepts one of the following:
    BetaTextBlockParam = object { text, type, cache_control, citations }
    text: string
    type: "text"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional array of BetaTextCitationParam
    Accepts one of the following:
    BetaCitationCharLocationParam = 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"
    BetaCitationPageLocationParam = 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"
    BetaCitationContentBlockLocationParam = 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"
    BetaCitationWebSearchResultLocationParam = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocationParam = 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"
    BetaImageBlockParam = object { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } or BetaURLImageSource { type, url } or BetaFileImageSource { file_id, type }
    Accepts one of the following:
    BetaBase64ImageSource = object { data, media_type, type }
    data: string
    media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"
    Accepts one of the following:
    "image/jpeg"
    "image/png"
    "image/gif"
    "image/webp"
    type: "base64"
    BetaURLImageSource = object { type, url }
    type: "url"
    url: string
    BetaFileImageSource = object { file_id, type }
    file_id: string
    type: "file"
    type: "image"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaURLPDFSource = object { type, url }
    type: "url"
    url: string
    BetaFileDocumentSource = object { file_id, type }
    file_id: string
    type: "file"
    type: "document"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaCitationsConfigParam { enabled }
    enabled: optional boolean
    context: optional string
    title: optional string
    BetaSearchResultBlockParam = object { content, source, title, 3 more }
    content: array of BetaTextBlockParam { text, type, cache_control, citations }
    text: string
    type: "text"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional array of BetaTextCitationParam
    Accepts one of the following:
    BetaCitationCharLocationParam = 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"
    BetaCitationPageLocationParam = 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"
    BetaCitationContentBlockLocationParam = 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"
    BetaCitationWebSearchResultLocationParam = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocationParam = 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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaCitationsConfigParam { enabled }
    enabled: optional boolean
    BetaThinkingBlockParam = object { signature, thinking, type }
    signature: string
    thinking: string
    type: "thinking"
    BetaRedactedThinkingBlockParam = object { data, type }
    data: string
    type: "redacted_thinking"
    BetaToolUseBlockParam = object { id, input, name, 3 more }
    id: string
    input: map[unknown]
    name: string
    type: "tool_use"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaDirectCaller { type } or BetaServerToolCaller { tool_id, type } or BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    BetaDirectCaller = object { type }

    Tool invocation directly from the model.

    type: "direct"
    BetaServerToolCaller = object { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: string
    type: "code_execution_20250825"
    BetaServerToolCaller20260120 = object { tool_id, type }
    tool_id: string
    type: "code_execution_20260120"
    BetaToolResultBlockParam = object { tool_use_id, type, cache_control, 2 more }
    tool_use_id: string
    type: "tool_result"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional string or array of BetaTextBlockParam { text, type, cache_control, citations } or BetaImageBlockParam { source, type, cache_control } or BetaSearchResultBlockParam { content, source, title, 3 more } or 2 more
    Accepts one of the following:
    UnionMember0 = string
    UnionMember1 = array of BetaTextBlockParam { text, type, cache_control, citations } or BetaImageBlockParam { source, type, cache_control } or BetaSearchResultBlockParam { content, source, title, 3 more } or 2 more
    Accepts one of the following:
    BetaTextBlockParam = object { text, type, cache_control, citations }
    text: string
    type: "text"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional array of BetaTextCitationParam
    Accepts one of the following:
    BetaCitationCharLocationParam = 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"
    BetaCitationPageLocationParam = 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"
    BetaCitationContentBlockLocationParam = 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"
    BetaCitationWebSearchResultLocationParam = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocationParam = 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"
    BetaImageBlockParam = object { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } or BetaURLImageSource { type, url } or BetaFileImageSource { file_id, type }
    Accepts one of the following:
    BetaBase64ImageSource = object { data, media_type, type }
    data: string
    media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"
    Accepts one of the following:
    "image/jpeg"
    "image/png"
    "image/gif"
    "image/webp"
    type: "base64"
    BetaURLImageSource = object { type, url }
    type: "url"
    url: string
    BetaFileImageSource = object { file_id, type }
    file_id: string
    type: "file"
    type: "image"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaSearchResultBlockParam = object { content, source, title, 3 more }
    content: array of BetaTextBlockParam { text, type, cache_control, citations }
    text: string
    type: "text"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional array of BetaTextCitationParam
    Accepts one of the following:
    BetaCitationCharLocationParam = 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"
    BetaCitationPageLocationParam = 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"
    BetaCitationContentBlockLocationParam = 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"
    BetaCitationWebSearchResultLocationParam = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocationParam = 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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaCitationsConfigParam { enabled }
    enabled: optional boolean
    BetaRequestDocumentBlock = object { source, type, cache_control, 3 more }
    source: BetaBase64PDFSource { data, media_type, type } or BetaPlainTextSource { data, media_type, type } or BetaContentBlockSource { content, type } or 2 more
    Accepts one of the following:
    BetaBase64PDFSource = object { data, media_type, type }
    data: string
    media_type: "application/pdf"
    type: "base64"
    BetaPlainTextSource = object { data, media_type, type }
    data: string
    media_type: "text/plain"
    type: "text"
    BetaContentBlockSource = object { content, type }
    content: string or array of BetaContentBlockSourceContent
    Accepts one of the following:
    UnionMember0 = string
    BetaContentBlockSourceContent = array of BetaContentBlockSourceContent
    Accepts one of the following:
    BetaTextBlockParam = object { text, type, cache_control, citations }
    text: string
    type: "text"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional array of BetaTextCitationParam
    Accepts one of the following:
    BetaCitationCharLocationParam = 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"
    BetaCitationPageLocationParam = 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"
    BetaCitationContentBlockLocationParam = 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"
    BetaCitationWebSearchResultLocationParam = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocationParam = 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"
    BetaImageBlockParam = object { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } or BetaURLImageSource { type, url } or BetaFileImageSource { file_id, type }
    Accepts one of the following:
    BetaBase64ImageSource = object { data, media_type, type }
    data: string
    media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"
    Accepts one of the following:
    "image/jpeg"
    "image/png"
    "image/gif"
    "image/webp"
    type: "base64"
    BetaURLImageSource = object { type, url }
    type: "url"
    url: string
    BetaFileImageSource = object { file_id, type }
    file_id: string
    type: "file"
    type: "image"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaURLPDFSource = object { type, url }
    type: "url"
    url: string
    BetaFileDocumentSource = object { file_id, type }
    file_id: string
    type: "file"
    type: "document"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaCitationsConfigParam { enabled }
    enabled: optional boolean
    context: optional string
    title: optional string
    BetaToolReferenceBlockParam = 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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional boolean
    BetaServerToolUseBlockParam = object { id, input, name, 3 more }
    id: string
    input: map[unknown]
    name: "web_search" or "web_fetch" or "code_execution" or 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: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaDirectCaller { type } or BetaServerToolCaller { tool_id, type } or BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    BetaDirectCaller = object { type }

    Tool invocation directly from the model.

    type: "direct"
    BetaServerToolCaller = object { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: string
    type: "code_execution_20250825"
    BetaServerToolCaller20260120 = object { tool_id, type }
    tool_id: string
    type: "code_execution_20260120"
    BetaWebSearchToolResultBlockParam = object { content, tool_use_id, type, 2 more }
    content: BetaWebSearchToolResultBlockParamContent
    Accepts one of the following:
    ResultBlock = array of BetaWebSearchResultBlockParam { encrypted_content, title, type, 2 more }
    encrypted_content: string
    title: string
    type: "web_search_result"
    url: string
    page_age: optional string
    BetaWebSearchToolRequestError = object { 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: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaDirectCaller { type } or BetaServerToolCaller { tool_id, type } or BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    BetaDirectCaller = object { type }

    Tool invocation directly from the model.

    type: "direct"
    BetaServerToolCaller = object { tool_id, type }

    Tool invocation generated by a server-side tool.

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

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional array of BetaTextCitationParam
    Accepts one of the following:
    BetaCitationCharLocationParam = 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"
    BetaCitationPageLocationParam = 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"
    BetaCitationContentBlockLocationParam = 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"
    BetaCitationWebSearchResultLocationParam = object { cited_text, encrypted_index, title, 2 more }
    cited_text: string
    encrypted_index: string
    title: string
    type: "web_search_result_location"
    url: string
    BetaCitationSearchResultLocationParam = 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"
    BetaImageBlockParam = object { source, type, cache_control }
    source: BetaBase64ImageSource { data, media_type, type } or BetaURLImageSource { type, url } or BetaFileImageSource { file_id, type }
    Accepts one of the following:
    BetaBase64ImageSource = object { data, media_type, type }
    data: string
    media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"
    Accepts one of the following:
    "image/jpeg"
    "image/png"
    "image/gif"
    "image/webp"
    type: "base64"
    BetaURLImageSource = object { type, url }
    type: "url"
    url: string
    BetaFileImageSource = object { file_id, type }
    file_id: string
    type: "file"
    type: "image"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaURLPDFSource = object { type, url }
    type: "url"
    url: string
    BetaFileDocumentSource = object { file_id, type }
    file_id: string
    type: "file"
    type: "document"
    cache_control: optional BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaCitationsConfigParam { 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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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: optional BetaDirectCaller { type } or BetaServerToolCaller { tool_id, type } or BetaServerToolCaller20260120 { tool_id, type }

    Tool invocation directly from the model.

    Accepts one of the following:
    BetaDirectCaller = object { type }

    Tool invocation directly from the model.

    type: "direct"
    BetaServerToolCaller = object { tool_id, type }

    Tool invocation generated by a server-side tool.

    tool_id: string
    type: "code_execution_20250825"
    BetaServerToolCaller20260120 = object { tool_id, type }
    tool_id: string
    type: "code_execution_20260120"
    BetaCodeExecutionToolResultBlockParam = object { 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:
    BetaCodeExecutionToolResultErrorParam = object { 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"
    BetaCodeExecutionResultBlockParam = object { content, return_code, stderr, 2 more }
    content: array of BetaCodeExecutionOutputBlockParam { file_id, type }
    file_id: string
    type: "code_execution_output"
    return_code: number
    stderr: string
    stdout: string
    type: "code_execution_result"
    BetaEncryptedCodeExecutionResultBlockParam = 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, type }
    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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaBashCodeExecutionToolResultBlockParam = object { content, tool_use_id, type, cache_control }
    content: BetaBashCodeExecutionToolResultErrorParam { error_code, type } or BetaBashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
    Accepts one of the following:
    BetaBashCodeExecutionToolResultErrorParam = object { error_code, type }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 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"
    BetaBashCodeExecutionResultBlockParam = object { content, return_code, stderr, 2 more }
    content: array of BetaBashCodeExecutionOutputBlockParam { file_id, type }
    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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaTextEditorCodeExecutionToolResultBlockParam = object { content, tool_use_id, type, cache_control }
    content: BetaTextEditorCodeExecutionToolResultErrorParam { error_code, type, error_message } or BetaTextEditorCodeExecutionViewResultBlockParam { content, file_type, type, 3 more } or BetaTextEditorCodeExecutionCreateResultBlockParam { is_file_update, type } or BetaTextEditorCodeExecutionStrReplaceResultBlockParam { type, lines, new_lines, 3 more }
    Accepts one of the following:
    BetaTextEditorCodeExecutionToolResultErrorParam = object { error_code, type, error_message }
    error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
    Accepts one of the following:
    "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
    BetaTextEditorCodeExecutionViewResultBlockParam = object { content, file_type, type, 3 more }
    content: string
    file_type: "text" or "image" or "pdf"
    Accepts one of the following:
    "text"
    "image"
    "pdf"
    type: "text_editor_code_execution_view_result"
    num_lines: optional number
    start_line: optional number
    total_lines: optional number
    BetaTextEditorCodeExecutionCreateResultBlockParam = object { is_file_update, type }
    is_file_update: boolean
    type: "text_editor_code_execution_create_result"
    BetaTextEditorCodeExecutionStrReplaceResultBlockParam = 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 BetaCacheControlEphemeral { type, ttl }

    Create a cache control breakpoint at this content block.

    type: "ephemeral"
    ttl: optional "5m" or "1h"

    The 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"
    BetaToolSearchToolResultBlockParam = object { content, tool_use_id, type, cache_control }
    content: BetaToolSearchToolResultErrorParam { error_code, type } or BetaToolSearchToolSearchResultBlockParam { tool_references, type }
    Accepts one of the following:
    BetaToolSearchToolResultErrorParam = object { error_code, type }