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
    class BetaApiError:
    required string Message
    JsonElement Type "api_error"constant
    class BetaAuthenticationError:
    required string Message
    JsonElement Type "authentication_error"constant
    class BetaBillingError:
    required string Message
    JsonElement Type "billing_error"constant
    class BetaError: A class that can be one of several variants.union
    class BetaInvalidRequestError:
    required string Message
    JsonElement Type "invalid_request_error"constant
    class BetaAuthenticationError:
    required string Message
    JsonElement Type "authentication_error"constant
    class BetaBillingError:
    required string Message
    JsonElement Type "billing_error"constant
    class BetaPermissionError:
    required string Message
    JsonElement Type "permission_error"constant
    class BetaNotFoundError:
    required string Message
    JsonElement Type "not_found_error"constant
    class BetaRateLimitError:
    required string Message
    JsonElement Type "rate_limit_error"constant
    class BetaGatewayTimeoutError:
    required string Message
    JsonElement Type "timeout_error"constant
    class BetaApiError:
    required string Message
    JsonElement Type "api_error"constant
    class BetaOverloadedError:
    required string Message
    JsonElement Type "overloaded_error"constant
    class BetaErrorResponse:
    required BetaError Error
    Accepts one of the following:
    class BetaInvalidRequestError:
    required string Message
    JsonElement Type "invalid_request_error"constant
    class BetaAuthenticationError:
    required string Message
    JsonElement Type "authentication_error"constant
    class BetaBillingError:
    required string Message
    JsonElement Type "billing_error"constant
    class BetaPermissionError:
    required string Message
    JsonElement Type "permission_error"constant
    class BetaNotFoundError:
    required string Message
    JsonElement Type "not_found_error"constant
    class BetaRateLimitError:
    required string Message
    JsonElement Type "rate_limit_error"constant
    class BetaGatewayTimeoutError:
    required string Message
    JsonElement Type "timeout_error"constant
    class BetaApiError:
    required string Message
    JsonElement Type "api_error"constant
    class BetaOverloadedError:
    required string Message
    JsonElement Type "overloaded_error"constant
    required string? RequestID
    JsonElement Type "error"constant
    class BetaGatewayTimeoutError:
    required string Message
    JsonElement Type "timeout_error"constant
    class BetaInvalidRequestError:
    required string Message
    JsonElement Type "invalid_request_error"constant
    class BetaNotFoundError:
    required string Message
    JsonElement Type "not_found_error"constant
    class BetaOverloadedError:
    required string Message
    JsonElement Type "overloaded_error"constant
    class BetaPermissionError:
    required string Message
    JsonElement Type "permission_error"constant
    class BetaRateLimitError:
    required string Message
    JsonElement Type "rate_limit_error"constant

    BetaModels

    List Models
    ModelListPageResponse Beta.Models.List(ModelListParams?parameters, CancellationTokencancellationToken = default)
    GET/v1/models
    Get a Model
    BetaModelInfo Beta.Models.Retrieve(ModelRetrieveParamsparameters, CancellationTokencancellationToken = default)
    GET/v1/models/{model_id}
    ModelsExpand Collapse
    class BetaModelInfo:
    required string ID

    Unique model identifier.

    required DateTimeOffset CreatedAt

    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.

    required string DisplayName

    A human-readable name for the model.

    JsonElement Type "model"constant

    Object type.

    For Models, this is always "model".

    BetaMessages

    Create a Message
    BetaMessage Beta.Messages.Create(MessageCreateParamsparameters, CancellationTokencancellationToken = default)
    POST/v1/messages
    Count tokens in a Message
    BetaMessageTokensCount Beta.Messages.CountTokens(MessageCountTokensParamsparameters, CancellationTokencancellationToken = default)
    POST/v1/messages/count_tokens
    ModelsExpand Collapse
    class BetaAllThinkingTurns:
    JsonElement Type "all"constant
    class BetaBase64ImageSource:
    required string Data
    required MediaType MediaType
    Accepts one of the following:
    "image/jpeg"ImageJpeg
    "image/png"ImagePng
    "image/gif"ImageGif
    "image/webp"ImageWebP
    JsonElement Type "base64"constant
    class BetaBase64PdfSource:
    required string Data
    JsonElement MediaType "application/pdf"constant
    JsonElement Type "base64"constant
    class BetaBashCodeExecutionOutputBlock:
    required string FileID
    JsonElement Type "bash_code_execution_output"constant
    class BetaBashCodeExecutionOutputBlockParam:
    required string FileID
    JsonElement Type "bash_code_execution_output"constant
    class BetaBashCodeExecutionResultBlock:
    required IReadOnlyList<BetaBashCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "bash_code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "bash_code_execution_result"constant
    class BetaBashCodeExecutionResultBlockParam:
    required IReadOnlyList<BetaBashCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "bash_code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "bash_code_execution_result"constant
    class BetaBashCodeExecutionToolResultBlock:
    required Content Content
    Accepts one of the following:
    class BetaBashCodeExecutionToolResultError:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    "output_file_too_large"OutputFileTooLarge
    JsonElement Type "bash_code_execution_tool_result_error"constant
    class BetaBashCodeExecutionResultBlock:
    required IReadOnlyList<BetaBashCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "bash_code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "bash_code_execution_result"constant
    required string ToolUseID
    JsonElement Type "bash_code_execution_tool_result"constant
    class BetaBashCodeExecutionToolResultBlockParam:
    required Content Content
    Accepts one of the following:
    class BetaBashCodeExecutionToolResultErrorParam:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    "output_file_too_large"OutputFileTooLarge
    JsonElement Type "bash_code_execution_tool_result_error"constant
    class BetaBashCodeExecutionResultBlockParam:
    required IReadOnlyList<BetaBashCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "bash_code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "bash_code_execution_result"constant
    required string ToolUseID
    JsonElement Type "bash_code_execution_tool_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaBashCodeExecutionToolResultError:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    "output_file_too_large"OutputFileTooLarge
    JsonElement Type "bash_code_execution_tool_result_error"constant
    class BetaBashCodeExecutionToolResultErrorParam:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    "output_file_too_large"OutputFileTooLarge
    JsonElement Type "bash_code_execution_tool_result_error"constant
    class BetaCacheControlEphemeral:
    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaCacheCreation:
    required Long Ephemeral1hInputTokens

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

    required Long Ephemeral5mInputTokens

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

    class BetaCitationCharLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required string? FileID
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationCharLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationConfig:
    required Boolean Enabled
    class BetaCitationContentBlockLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required string? FileID
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationContentBlockLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationPageLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required string? FileID
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationPageLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationSearchResultLocation:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    class BetaCitationSearchResultLocationParam:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    class BetaCitationWebSearchResultLocationParam:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationsConfigParam:
    Boolean Enabled
    class BetaCitationsDelta:
    required Citation Citation
    Accepts one of the following:
    class BetaCitationCharLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required string? FileID
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required string? FileID
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required string? FileID
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationsWebSearchResultLocation:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocation:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    JsonElement Type "citations_delta"constant
    class BetaCitationsWebSearchResultLocation:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaClearThinking20251015Edit:
    JsonElement Type "clear_thinking_20251015"constant
    Keep Keep

    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:
    JsonElement Type "thinking_turns"constant
    required Long Value
    class BetaAllThinkingTurns:
    JsonElement Type "all"constant
    class All:
    class BetaClearThinking20251015EditResponse:
    required Long ClearedInputTokens

    Number of input tokens cleared by this edit.

    required Long ClearedThinkingTurns

    Number of thinking turns that were cleared.

    JsonElement Type "clear_thinking_20251015"constant

    The type of context management edit applied.

    class BetaClearToolUses20250919Edit:
    JsonElement Type "clear_tool_uses_20250919"constant
    BetaInputTokensClearAtLeast? ClearAtLeast

    Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.

    JsonElement Type "input_tokens"constant
    required Long Value
    ClearToolInputs? ClearToolInputs

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

    Accepts one of the following:
    Boolean
    IReadOnlyList<string>
    IReadOnlyList<string>? ExcludeTools

    Tool names whose uses are preserved from clearing

    BetaToolUsesKeep Keep

    Number of tool uses to retain in the conversation

    JsonElement Type "tool_uses"constant
    required Long Value
    Trigger Trigger

    Condition that triggers the context management strategy

    Accepts one of the following:
    class BetaInputTokensTrigger:
    JsonElement Type "input_tokens"constant
    required Long Value
    class BetaToolUsesTrigger:
    JsonElement Type "tool_uses"constant
    required Long Value
    class BetaClearToolUses20250919EditResponse:
    required Long ClearedInputTokens

    Number of input tokens cleared by this edit.

    required Long ClearedToolUses

    Number of tool uses that were cleared.

    JsonElement Type "clear_tool_uses_20250919"constant

    The type of context management edit applied.

    class BetaCodeExecutionOutputBlock:
    required string FileID
    JsonElement Type "code_execution_output"constant
    class BetaCodeExecutionOutputBlockParam:
    required string FileID
    JsonElement Type "code_execution_output"constant
    class BetaCodeExecutionResultBlock:
    required IReadOnlyList<BetaCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "code_execution_result"constant
    class BetaCodeExecutionResultBlockParam:
    required IReadOnlyList<BetaCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "code_execution_result"constant
    class BetaCodeExecutionTool20250522:
    JsonElement Name "code_execution"constant

    Name of the tool.

    This is how the tool will be called by the model and in tool_use blocks.

    JsonElement Type "code_execution_20250522"constant
    IReadOnlyList<AllowedCaller> AllowedCallers
    Accepts one of the following:
    "direct"Direct
    "code_execution_20250825"CodeExecution20250825
    "code_execution_20260120"CodeExecution20260120
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Boolean DeferLoading

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

    Boolean Strict

    When true, guarantees schema validation on tool names and inputs

    class BetaCodeExecutionTool20250825:
    JsonElement Name "code_execution"constant

    Name of the tool.

    This is how the tool will be called by the model and in tool_use blocks.

    JsonElement Type "code_execution_20250825"constant
    IReadOnlyList<AllowedCaller> AllowedCallers
    Accepts one of the following:
    "direct"Direct
    "code_execution_20250825"CodeExecution20250825
    "code_execution_20260120"CodeExecution20260120
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Boolean DeferLoading

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

    Boolean Strict

    When true, guarantees schema validation on tool names and inputs

    class BetaCodeExecutionTool20260120:

    Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).

    JsonElement Name "code_execution"constant

    Name of the tool.

    This is how the tool will be called by the model and in tool_use blocks.

    JsonElement Type "code_execution_20260120"constant
    IReadOnlyList<AllowedCaller> AllowedCallers
    Accepts one of the following:
    "direct"Direct
    "code_execution_20250825"CodeExecution20250825
    "code_execution_20260120"CodeExecution20260120
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Boolean DeferLoading

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

    Boolean Strict

    When true, guarantees schema validation on tool names and inputs

    class BetaCodeExecutionToolResultBlock:
    required BetaCodeExecutionToolResultBlockContent Content

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

    Accepts one of the following:
    class BetaCodeExecutionToolResultError:
    required BetaCodeExecutionToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "code_execution_tool_result_error"constant
    class BetaCodeExecutionResultBlock:
    required IReadOnlyList<BetaCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "code_execution_result"constant
    class BetaEncryptedCodeExecutionResultBlock:

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

    required IReadOnlyList<BetaCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required string EncryptedStdout
    required Long ReturnCode
    required string Stderr
    JsonElement Type "encrypted_code_execution_result"constant
    required string ToolUseID
    JsonElement Type "code_execution_tool_result"constant
    class BetaCodeExecutionToolResultBlockContent: A class that can be one of several variants.union

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

    class BetaCodeExecutionToolResultError:
    required BetaCodeExecutionToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "code_execution_tool_result_error"constant
    class BetaCodeExecutionResultBlock:
    required IReadOnlyList<BetaCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "code_execution_result"constant
    class BetaEncryptedCodeExecutionResultBlock:

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

    required IReadOnlyList<BetaCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required string EncryptedStdout
    required Long ReturnCode
    required string Stderr
    JsonElement Type "encrypted_code_execution_result"constant
    class BetaCodeExecutionToolResultBlockParam:
    required BetaCodeExecutionToolResultBlockParamContent Content

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

    Accepts one of the following:
    class BetaCodeExecutionToolResultErrorParam:
    required BetaCodeExecutionToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "code_execution_tool_result_error"constant
    class BetaCodeExecutionResultBlockParam:
    required IReadOnlyList<BetaCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "code_execution_result"constant
    class BetaEncryptedCodeExecutionResultBlockParam:

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

    required IReadOnlyList<BetaCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required string EncryptedStdout
    required Long ReturnCode
    required string Stderr
    JsonElement Type "encrypted_code_execution_result"constant
    required string ToolUseID
    JsonElement Type "code_execution_tool_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaCodeExecutionToolResultBlockParamContent: A class that can be one of several variants.union

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

    class BetaCodeExecutionToolResultErrorParam:
    required BetaCodeExecutionToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "code_execution_tool_result_error"constant
    class BetaCodeExecutionResultBlockParam:
    required IReadOnlyList<BetaCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "code_execution_result"constant
    class BetaEncryptedCodeExecutionResultBlockParam:

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

    required IReadOnlyList<BetaCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required string EncryptedStdout
    required Long ReturnCode
    required string Stderr
    JsonElement Type "encrypted_code_execution_result"constant
    class BetaCodeExecutionToolResultError:
    required BetaCodeExecutionToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "code_execution_tool_result_error"constant
    enum BetaCodeExecutionToolResultErrorCode:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    class BetaCodeExecutionToolResultErrorParam:
    required BetaCodeExecutionToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "code_execution_tool_result_error"constant
    class BetaCompact20260112Edit:

    Automatically compact older context when reaching the configured trigger threshold.

    JsonElement Type "compact_20260112"constant
    string? Instructions

    Additional instructions for summarization.

    Boolean PauseAfterCompaction

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

    BetaInputTokensTrigger? Trigger

    When to trigger compaction. Defaults to 150000 input tokens.

    JsonElement Type "input_tokens"constant
    required Long Value
    class BetaCompactionBlock:

    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.

    required string? Content

    Summary of compacted content, or null if compaction failed

    JsonElement Type "compaction"constant
    class BetaCompactionBlockParam:

    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.

    required string? Content

    Summary of previously compacted content, or null if compaction failed

    JsonElement Type "compaction"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaCompactionContentBlockDelta:
    required string? Content
    JsonElement Type "compaction_delta"constant
    class BetaCompactionIterationUsage:

    Token usage for a compaction iteration.

    required BetaCacheCreation? CacheCreation

    Breakdown of cached tokens by TTL

    required Long Ephemeral1hInputTokens

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

    required Long Ephemeral5mInputTokens

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

    required Long CacheCreationInputTokens

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

    required Long CacheReadInputTokens

    The number of input tokens read from the cache.

    required Long InputTokens

    The number of input tokens which were used.

    required Long OutputTokens

    The number of output tokens which were used.

    JsonElement Type "compaction"constant

    Usage for a compaction iteration

    class BetaContainer:

    Information about the container used in the request (for the code execution tool)

    required string ID

    Identifier for the container used in this request

    required DateTimeOffset ExpiresAt

    The time at which the container will expire.

    required IReadOnlyList<BetaSkill>? Skills

    Skills loaded in the container

    required string SkillID

    Skill ID

    required Type Type

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

    Accepts one of the following:
    "anthropic"Anthropic
    "custom"Custom
    required string Version

    Skill version or 'latest' for most recent version

    class BetaContainerParams:

    Container parameters with skills to be loaded.

    string? ID

    Container id

    IReadOnlyList<BetaSkillParams>? Skills

    List of skills to load in the container

    required string SkillID

    Skill ID

    required Type Type

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

    Accepts one of the following:
    "anthropic"Anthropic
    "custom"Custom
    string Version

    Skill version or 'latest' for most recent version

    class BetaContainerUploadBlock:

    Response model for a file uploaded to the container.

    required string FileID
    JsonElement Type "container_upload"constant
    class BetaContainerUploadBlockParam:

    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.

    required string FileID
    JsonElement Type "container_upload"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaContentBlock: A class that can be one of several variants.union

    Response model for a file uploaded to the container.

    class BetaTextBlock:
    required IReadOnlyList<BetaTextCitation>? Citations

    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:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required string? FileID
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required string? FileID
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required string? FileID
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationsWebSearchResultLocation:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocation:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    required string Text
    JsonElement Type "text"constant
    class BetaThinkingBlock:
    required string Signature
    required string Thinking
    JsonElement Type "thinking"constant
    class BetaRedactedThinkingBlock:
    required string Data
    JsonElement Type "redacted_thinking"constant
    class BetaToolUseBlock:
    required string ID
    required IReadOnlyDictionary<string, JsonElement> Input
    required string Name
    JsonElement Type "tool_use"constant
    Caller Caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller:

    Tool invocation directly from the model.

    JsonElement Type "direct"constant
    class BetaServerToolCaller:

    Tool invocation generated by a server-side tool.

    required string ToolID
    JsonElement Type "code_execution_20250825"constant
    class BetaServerToolCaller20260120:
    required string ToolID
    JsonElement Type "code_execution_20260120"constant
    class BetaServerToolUseBlock:
    required string ID
    required IReadOnlyDictionary<string, JsonElement> Input
    required Name Name
    Accepts one of the following:
    "web_search"WebSearch
    "web_fetch"WebFetch
    "code_execution"CodeExecution
    "bash_code_execution"BashCodeExecution
    "text_editor_code_execution"TextEditorCodeExecution
    "tool_search_tool_regex"ToolSearchToolRegex
    "tool_search_tool_bm25"ToolSearchToolBm25
    JsonElement Type "server_tool_use"constant
    Caller Caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller:

    Tool invocation directly from the model.

    JsonElement Type "direct"constant
    class BetaServerToolCaller:

    Tool invocation generated by a server-side tool.

    required string ToolID
    JsonElement Type "code_execution_20250825"constant
    class BetaServerToolCaller20260120:
    required string ToolID
    JsonElement Type "code_execution_20260120"constant
    class BetaWebSearchToolResultBlock:
    required BetaWebSearchToolResultBlockContent Content
    Accepts one of the following:
    class BetaWebSearchToolResultError:
    required BetaWebSearchToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "max_uses_exceeded"MaxUsesExceeded
    "too_many_requests"TooManyRequests
    "query_too_long"QueryTooLong
    "request_too_large"RequestTooLarge
    JsonElement Type "web_search_tool_result_error"constant
    IReadOnlyList<BetaWebSearchResultBlock>
    required string EncryptedContent
    required string? PageAge
    required string Title
    JsonElement Type "web_search_result"constant
    required string Url
    required string ToolUseID
    JsonElement Type "web_search_tool_result"constant
    Caller Caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller:

    Tool invocation directly from the model.

    JsonElement Type "direct"constant
    class BetaServerToolCaller:

    Tool invocation generated by a server-side tool.

    required string ToolID
    JsonElement Type "code_execution_20250825"constant
    class BetaServerToolCaller20260120:
    required string ToolID
    JsonElement Type "code_execution_20260120"constant
    class BetaWebFetchToolResultBlock:
    required Content Content
    Accepts one of the following:
    class BetaWebFetchToolResultErrorBlock:
    required BetaWebFetchToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "url_too_long"UrlTooLong
    "url_not_allowed"UrlNotAllowed
    "url_not_accessible"UrlNotAccessible
    "unsupported_content_type"UnsupportedContentType
    "too_many_requests"TooManyRequests
    "max_uses_exceeded"MaxUsesExceeded
    "unavailable"Unavailable
    JsonElement Type "web_fetch_tool_result_error"constant
    class BetaWebFetchBlock:
    required BetaDocumentBlock Content
    required BetaCitationConfig? Citations

    Citation configuration for the document

    required Boolean Enabled
    required Source Source
    Accepts one of the following:
    class BetaBase64PdfSource:
    required string Data
    JsonElement MediaType "application/pdf"constant
    JsonElement Type "base64"constant
    class BetaPlainTextSource:
    required string Data
    JsonElement MediaType "text/plain"constant
    JsonElement Type "text"constant
    required string? Title

    The title of the document

    JsonElement Type "document"constant
    required string? RetrievedAt

    ISO 8601 timestamp when the content was retrieved

    JsonElement Type "web_fetch_result"constant
    required string Url

    Fetched content URL

    required string ToolUseID
    JsonElement Type "web_fetch_tool_result"constant
    Caller Caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller:

    Tool invocation directly from the model.

    JsonElement Type "direct"constant
    class BetaServerToolCaller:

    Tool invocation generated by a server-side tool.

    required string ToolID
    JsonElement Type "code_execution_20250825"constant
    class BetaServerToolCaller20260120:
    required string ToolID
    JsonElement Type "code_execution_20260120"constant
    class BetaCodeExecutionToolResultBlock:
    required BetaCodeExecutionToolResultBlockContent Content

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

    Accepts one of the following:
    class BetaCodeExecutionToolResultError:
    required BetaCodeExecutionToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "code_execution_tool_result_error"constant
    class BetaCodeExecutionResultBlock:
    required IReadOnlyList<BetaCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "code_execution_result"constant
    class BetaEncryptedCodeExecutionResultBlock:

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

    required IReadOnlyList<BetaCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required string EncryptedStdout
    required Long ReturnCode
    required string Stderr
    JsonElement Type "encrypted_code_execution_result"constant
    required string ToolUseID
    JsonElement Type "code_execution_tool_result"constant
    class BetaBashCodeExecutionToolResultBlock:
    required Content Content
    Accepts one of the following:
    class BetaBashCodeExecutionToolResultError:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    "output_file_too_large"OutputFileTooLarge
    JsonElement Type "bash_code_execution_tool_result_error"constant
    class BetaBashCodeExecutionResultBlock:
    required IReadOnlyList<BetaBashCodeExecutionOutputBlock> Content
    required string FileID
    JsonElement Type "bash_code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "bash_code_execution_result"constant
    required string ToolUseID
    JsonElement Type "bash_code_execution_tool_result"constant
    class BetaTextEditorCodeExecutionToolResultBlock:
    required Content Content
    Accepts one of the following:
    class BetaTextEditorCodeExecutionToolResultError:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    "file_not_found"FileNotFound
    required string? ErrorMessage
    JsonElement Type "text_editor_code_execution_tool_result_error"constant
    class BetaTextEditorCodeExecutionViewResultBlock:
    required string Content
    required FileType FileType
    Accepts one of the following:
    "text"Text
    "image"Image
    "pdf"Pdf
    required Long? NumLines
    required Long? StartLine
    required Long? TotalLines
    JsonElement Type "text_editor_code_execution_view_result"constant
    class BetaTextEditorCodeExecutionCreateResultBlock:
    required Boolean IsFileUpdate
    JsonElement Type "text_editor_code_execution_create_result"constant
    class BetaTextEditorCodeExecutionStrReplaceResultBlock:
    required IReadOnlyList<string>? Lines
    required Long? NewLines
    required Long? NewStart
    required Long? OldLines
    required Long? OldStart
    JsonElement Type "text_editor_code_execution_str_replace_result"constant
    required string ToolUseID
    JsonElement Type "text_editor_code_execution_tool_result"constant
    class BetaToolSearchToolResultBlock:
    required Content Content
    Accepts one of the following:
    class BetaToolSearchToolResultError:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    required string? ErrorMessage
    JsonElement Type "tool_search_tool_result_error"constant
    class BetaToolSearchToolSearchResultBlock:
    required IReadOnlyList<BetaToolReferenceBlock> ToolReferences
    required string ToolName
    JsonElement Type "tool_reference"constant
    JsonElement Type "tool_search_tool_search_result"constant
    required string ToolUseID
    JsonElement Type "tool_search_tool_result"constant
    class BetaMcpToolUseBlock:
    required string ID
    required IReadOnlyDictionary<string, JsonElement> Input
    required string Name

    The name of the MCP tool

    required string ServerName

    The name of the MCP server

    JsonElement Type "mcp_tool_use"constant
    class BetaMcpToolResultBlock:
    required Content Content
    Accepts one of the following:
    string
    IReadOnlyList<BetaTextBlock>
    required IReadOnlyList<BetaTextCitation>? Citations

    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:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required string? FileID
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required string? FileID
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocation:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required string? FileID
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationsWebSearchResultLocation:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocation:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    required string Text
    JsonElement Type "text"constant
    required Boolean IsError
    required string ToolUseID
    JsonElement Type "mcp_tool_result"constant
    class BetaContainerUploadBlock:

    Response model for a file uploaded to the container.

    required string FileID
    JsonElement Type "container_upload"constant
    class BetaCompactionBlock:

    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.

    required string? Content

    Summary of compacted content, or null if compaction failed

    JsonElement Type "compaction"constant
    class BetaContentBlockParam: A class that can be one of several variants.union

    Regular text content.

    class BetaTextBlockParam:
    required string Text
    JsonElement Type "text"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    IReadOnlyList<BetaTextCitationParam>? Citations
    Accepts one of the following:
    class BetaCitationCharLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationWebSearchResultLocationParam:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocationParam:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    class BetaImageBlockParam:
    required Source Source
    Accepts one of the following:
    class BetaBase64ImageSource:
    required string Data
    required MediaType MediaType
    Accepts one of the following:
    "image/jpeg"ImageJpeg
    "image/png"ImagePng
    "image/gif"ImageGif
    "image/webp"ImageWebP
    JsonElement Type "base64"constant
    class BetaUrlImageSource:
    JsonElement Type "url"constant
    required string Url
    class BetaFileImageSource:
    required string FileID
    JsonElement Type "file"constant
    JsonElement Type "image"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaRequestDocumentBlock:
    required Source Source
    Accepts one of the following:
    class BetaBase64PdfSource:
    required string Data
    JsonElement MediaType "application/pdf"constant
    JsonElement Type "base64"constant
    class BetaPlainTextSource:
    required string Data
    JsonElement MediaType "text/plain"constant
    JsonElement Type "text"constant
    class BetaContentBlockSource:
    required Content Content
    Accepts one of the following:
    string
    IReadOnlyList<BetaContentBlockSourceContent>
    Accepts one of the following:
    class BetaTextBlockParam:
    required string Text
    JsonElement Type "text"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    IReadOnlyList<BetaTextCitationParam>? Citations
    Accepts one of the following:
    class BetaCitationCharLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationWebSearchResultLocationParam:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocationParam:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    class BetaImageBlockParam:
    required Source Source
    Accepts one of the following:
    class BetaBase64ImageSource:
    required string Data
    required MediaType MediaType
    Accepts one of the following:
    "image/jpeg"ImageJpeg
    "image/png"ImagePng
    "image/gif"ImageGif
    "image/webp"ImageWebP
    JsonElement Type "base64"constant
    class BetaUrlImageSource:
    JsonElement Type "url"constant
    required string Url
    class BetaFileImageSource:
    required string FileID
    JsonElement Type "file"constant
    JsonElement Type "image"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    JsonElement Type "content"constant
    class BetaUrlPdfSource:
    JsonElement Type "url"constant
    required string Url
    class BetaFileDocumentSource:
    required string FileID
    JsonElement Type "file"constant
    JsonElement Type "document"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    BetaCitationsConfigParam? Citations
    Boolean Enabled
    string? Context
    string? Title
    class BetaSearchResultBlockParam:
    required IReadOnlyList<BetaTextBlockParam> Content
    required string Text
    JsonElement Type "text"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    IReadOnlyList<BetaTextCitationParam>? Citations
    Accepts one of the following:
    class BetaCitationCharLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationWebSearchResultLocationParam:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocationParam:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    required string Source
    required string Title
    JsonElement Type "search_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    BetaCitationsConfigParam Citations
    Boolean Enabled
    class BetaThinkingBlockParam:
    required string Signature
    required string Thinking
    JsonElement Type "thinking"constant
    class BetaRedactedThinkingBlockParam:
    required string Data
    JsonElement Type "redacted_thinking"constant
    class BetaToolUseBlockParam:
    required string ID
    required IReadOnlyDictionary<string, JsonElement> Input
    required string Name
    JsonElement Type "tool_use"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Caller Caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller:

    Tool invocation directly from the model.

    JsonElement Type "direct"constant
    class BetaServerToolCaller:

    Tool invocation generated by a server-side tool.

    required string ToolID
    JsonElement Type "code_execution_20250825"constant
    class BetaServerToolCaller20260120:
    required string ToolID
    JsonElement Type "code_execution_20260120"constant
    class BetaToolResultBlockParam:
    required string ToolUseID
    JsonElement Type "tool_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Content Content
    Accepts one of the following:
    string
    IReadOnlyList<Block>
    Accepts one of the following:
    class BetaTextBlockParam:
    required string Text
    JsonElement Type "text"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    IReadOnlyList<BetaTextCitationParam>? Citations
    Accepts one of the following:
    class BetaCitationCharLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationWebSearchResultLocationParam:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocationParam:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    class BetaImageBlockParam:
    required Source Source
    Accepts one of the following:
    class BetaBase64ImageSource:
    required string Data
    required MediaType MediaType
    Accepts one of the following:
    "image/jpeg"ImageJpeg
    "image/png"ImagePng
    "image/gif"ImageGif
    "image/webp"ImageWebP
    JsonElement Type "base64"constant
    class BetaUrlImageSource:
    JsonElement Type "url"constant
    required string Url
    class BetaFileImageSource:
    required string FileID
    JsonElement Type "file"constant
    JsonElement Type "image"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaSearchResultBlockParam:
    required IReadOnlyList<BetaTextBlockParam> Content
    required string Text
    JsonElement Type "text"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    IReadOnlyList<BetaTextCitationParam>? Citations
    Accepts one of the following:
    class BetaCitationCharLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationWebSearchResultLocationParam:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocationParam:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    required string Source
    required string Title
    JsonElement Type "search_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    BetaCitationsConfigParam Citations
    Boolean Enabled
    class BetaRequestDocumentBlock:
    required Source Source
    Accepts one of the following:
    class BetaBase64PdfSource:
    required string Data
    JsonElement MediaType "application/pdf"constant
    JsonElement Type "base64"constant
    class BetaPlainTextSource:
    required string Data
    JsonElement MediaType "text/plain"constant
    JsonElement Type "text"constant
    class BetaContentBlockSource:
    required Content Content
    Accepts one of the following:
    string
    IReadOnlyList<BetaContentBlockSourceContent>
    Accepts one of the following:
    class BetaTextBlockParam:
    required string Text
    JsonElement Type "text"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    IReadOnlyList<BetaTextCitationParam>? Citations
    Accepts one of the following:
    class BetaCitationCharLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationWebSearchResultLocationParam:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocationParam:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    class BetaImageBlockParam:
    required Source Source
    Accepts one of the following:
    class BetaBase64ImageSource:
    required string Data
    required MediaType MediaType
    Accepts one of the following:
    "image/jpeg"ImageJpeg
    "image/png"ImagePng
    "image/gif"ImageGif
    "image/webp"ImageWebP
    JsonElement Type "base64"constant
    class BetaUrlImageSource:
    JsonElement Type "url"constant
    required string Url
    class BetaFileImageSource:
    required string FileID
    JsonElement Type "file"constant
    JsonElement Type "image"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    JsonElement Type "content"constant
    class BetaUrlPdfSource:
    JsonElement Type "url"constant
    required string Url
    class BetaFileDocumentSource:
    required string FileID
    JsonElement Type "file"constant
    JsonElement Type "document"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    BetaCitationsConfigParam? Citations
    Boolean Enabled
    string? Context
    string? Title
    class BetaToolReferenceBlockParam:

    Tool reference block that can be included in tool_result content.

    required string ToolName
    JsonElement Type "tool_reference"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Boolean IsError
    class BetaServerToolUseBlockParam:
    required string ID
    required IReadOnlyDictionary<string, JsonElement> Input
    required Name Name
    Accepts one of the following:
    "web_search"WebSearch
    "web_fetch"WebFetch
    "code_execution"CodeExecution
    "bash_code_execution"BashCodeExecution
    "text_editor_code_execution"TextEditorCodeExecution
    "tool_search_tool_regex"ToolSearchToolRegex
    "tool_search_tool_bm25"ToolSearchToolBm25
    JsonElement Type "server_tool_use"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Caller Caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller:

    Tool invocation directly from the model.

    JsonElement Type "direct"constant
    class BetaServerToolCaller:

    Tool invocation generated by a server-side tool.

    required string ToolID
    JsonElement Type "code_execution_20250825"constant
    class BetaServerToolCaller20260120:
    required string ToolID
    JsonElement Type "code_execution_20260120"constant
    class BetaWebSearchToolResultBlockParam:
    required BetaWebSearchToolResultBlockParamContent Content
    Accepts one of the following:
    IReadOnlyList<BetaWebSearchResultBlockParam>
    required string EncryptedContent
    required string Title
    JsonElement Type "web_search_result"constant
    required string Url
    string? PageAge
    class BetaWebSearchToolRequestError:
    required BetaWebSearchToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "max_uses_exceeded"MaxUsesExceeded
    "too_many_requests"TooManyRequests
    "query_too_long"QueryTooLong
    "request_too_large"RequestTooLarge
    JsonElement Type "web_search_tool_result_error"constant
    required string ToolUseID
    JsonElement Type "web_search_tool_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Caller Caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller:

    Tool invocation directly from the model.

    JsonElement Type "direct"constant
    class BetaServerToolCaller:

    Tool invocation generated by a server-side tool.

    required string ToolID
    JsonElement Type "code_execution_20250825"constant
    class BetaServerToolCaller20260120:
    required string ToolID
    JsonElement Type "code_execution_20260120"constant
    class BetaWebFetchToolResultBlockParam:
    required Content Content
    Accepts one of the following:
    class BetaWebFetchToolResultErrorBlockParam:
    required BetaWebFetchToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "url_too_long"UrlTooLong
    "url_not_allowed"UrlNotAllowed
    "url_not_accessible"UrlNotAccessible
    "unsupported_content_type"UnsupportedContentType
    "too_many_requests"TooManyRequests
    "max_uses_exceeded"MaxUsesExceeded
    "unavailable"Unavailable
    JsonElement Type "web_fetch_tool_result_error"constant
    class BetaWebFetchBlockParam:
    required BetaRequestDocumentBlock Content
    required Source Source
    Accepts one of the following:
    class BetaBase64PdfSource:
    required string Data
    JsonElement MediaType "application/pdf"constant
    JsonElement Type "base64"constant
    class BetaPlainTextSource:
    required string Data
    JsonElement MediaType "text/plain"constant
    JsonElement Type "text"constant
    class BetaContentBlockSource:
    required Content Content
    Accepts one of the following:
    string
    IReadOnlyList<BetaContentBlockSourceContent>
    Accepts one of the following:
    class BetaTextBlockParam:
    required string Text
    JsonElement Type "text"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    IReadOnlyList<BetaTextCitationParam>? Citations
    Accepts one of the following:
    class BetaCitationCharLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndCharIndex
    required Long StartCharIndex
    JsonElement Type "char_location"constant
    class BetaCitationPageLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndPageNumber
    required Long StartPageNumber
    JsonElement Type "page_location"constant
    class BetaCitationContentBlockLocationParam:
    required string CitedText
    required Long DocumentIndex
    required string? DocumentTitle
    required Long EndBlockIndex
    required Long StartBlockIndex
    JsonElement Type "content_block_location"constant
    class BetaCitationWebSearchResultLocationParam:
    required string CitedText
    required string EncryptedIndex
    required string? Title
    JsonElement Type "web_search_result_location"constant
    required string Url
    class BetaCitationSearchResultLocationParam:
    required string CitedText
    required Long EndBlockIndex
    required Long SearchResultIndex
    required string Source
    required Long StartBlockIndex
    required string? Title
    JsonElement Type "search_result_location"constant
    class BetaImageBlockParam:
    required Source Source
    Accepts one of the following:
    class BetaBase64ImageSource:
    required string Data
    required MediaType MediaType
    Accepts one of the following:
    "image/jpeg"ImageJpeg
    "image/png"ImagePng
    "image/gif"ImageGif
    "image/webp"ImageWebP
    JsonElement Type "base64"constant
    class BetaUrlImageSource:
    JsonElement Type "url"constant
    required string Url
    class BetaFileImageSource:
    required string FileID
    JsonElement Type "file"constant
    JsonElement Type "image"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    JsonElement Type "content"constant
    class BetaUrlPdfSource:
    JsonElement Type "url"constant
    required string Url
    class BetaFileDocumentSource:
    required string FileID
    JsonElement Type "file"constant
    JsonElement Type "document"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    BetaCitationsConfigParam? Citations
    Boolean Enabled
    string? Context
    string? Title
    JsonElement Type "web_fetch_result"constant
    required string Url

    Fetched content URL

    string? RetrievedAt

    ISO 8601 timestamp when the content was retrieved

    required string ToolUseID
    JsonElement Type "web_fetch_tool_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    Caller Caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class BetaDirectCaller:

    Tool invocation directly from the model.

    JsonElement Type "direct"constant
    class BetaServerToolCaller:

    Tool invocation generated by a server-side tool.

    required string ToolID
    JsonElement Type "code_execution_20250825"constant
    class BetaServerToolCaller20260120:
    required string ToolID
    JsonElement Type "code_execution_20260120"constant
    class BetaCodeExecutionToolResultBlockParam:
    required BetaCodeExecutionToolResultBlockParamContent Content

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

    Accepts one of the following:
    class BetaCodeExecutionToolResultErrorParam:
    required BetaCodeExecutionToolResultErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "code_execution_tool_result_error"constant
    class BetaCodeExecutionResultBlockParam:
    required IReadOnlyList<BetaCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "code_execution_result"constant
    class BetaEncryptedCodeExecutionResultBlockParam:

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

    required IReadOnlyList<BetaCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "code_execution_output"constant
    required string EncryptedStdout
    required Long ReturnCode
    required string Stderr
    JsonElement Type "encrypted_code_execution_result"constant
    required string ToolUseID
    JsonElement Type "code_execution_tool_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaBashCodeExecutionToolResultBlockParam:
    required Content Content
    Accepts one of the following:
    class BetaBashCodeExecutionToolResultErrorParam:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    "output_file_too_large"OutputFileTooLarge
    JsonElement Type "bash_code_execution_tool_result_error"constant
    class BetaBashCodeExecutionResultBlockParam:
    required IReadOnlyList<BetaBashCodeExecutionOutputBlockParam> Content
    required string FileID
    JsonElement Type "bash_code_execution_output"constant
    required Long ReturnCode
    required string Stderr
    required string Stdout
    JsonElement Type "bash_code_execution_result"constant
    required string ToolUseID
    JsonElement Type "bash_code_execution_tool_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaTextEditorCodeExecutionToolResultBlockParam:
    required Content Content
    Accepts one of the following:
    class BetaTextEditorCodeExecutionToolResultErrorParam:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    "file_not_found"FileNotFound
    JsonElement Type "text_editor_code_execution_tool_result_error"constant
    string? ErrorMessage
    class BetaTextEditorCodeExecutionViewResultBlockParam:
    required string Content
    required FileType FileType
    Accepts one of the following:
    "text"Text
    "image"Image
    "pdf"Pdf
    JsonElement Type "text_editor_code_execution_view_result"constant
    Long? NumLines
    Long? StartLine
    Long? TotalLines
    class BetaTextEditorCodeExecutionCreateResultBlockParam:
    required Boolean IsFileUpdate
    JsonElement Type "text_editor_code_execution_create_result"constant
    class BetaTextEditorCodeExecutionStrReplaceResultBlockParam:
    JsonElement Type "text_editor_code_execution_str_replace_result"constant
    IReadOnlyList<string>? Lines
    Long? NewLines
    Long? NewStart
    Long? OldLines
    Long? OldStart
    required string ToolUseID
    JsonElement Type "text_editor_code_execution_tool_result"constant
    BetaCacheControlEphemeral? CacheControl

    Create a cache control breakpoint at this content block.

    JsonElement Type "ephemeral"constant
    Ttl Ttl

    The 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"Ttl5m
    "1h"Ttl1h
    class BetaToolSearchToolResultBlockParam:
    required Content Content
    Accepts one of the following:
    class BetaToolSearchToolResultErrorParam:
    required ErrorCode ErrorCode
    Accepts one of the following:
    "invalid_tool_input"InvalidToolInput
    "unavailable"Unavailable
    "too_many_requests"TooManyRequests
    "execution_time_exceeded"ExecutionTimeExceeded
    JsonElement Type "tool_search_tool_result_error"constant