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

    Messages

    Create a Message
    client.Messages.New(ctx, body) (*Message, error)
    POST/v1/messages
    Count tokens in a Message
    client.Messages.CountTokens(ctx, body) (*MessageTokensCount, error)
    POST/v1/messages/count_tokens
    ModelsExpand Collapse
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type Base64PDFSource struct{…}
    Data string
    MediaType ApplicationPDF
    Type Base64
    type BashCodeExecutionOutputBlock struct{…}
    FileID string
    Type BashCodeExecutionOutput
    type BashCodeExecutionOutputBlockParamResp struct{…}
    FileID string
    Type BashCodeExecutionOutput
    type BashCodeExecutionResultBlock struct{…}
    Content []BashCodeExecutionOutputBlock
    FileID string
    Type BashCodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type BashCodeExecutionResult
    type BashCodeExecutionResultBlockParamResp struct{…}
    Content []BashCodeExecutionOutputBlockParamResp
    FileID string
    Type BashCodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type BashCodeExecutionResult
    type BashCodeExecutionToolResultBlock struct{…}
    Content BashCodeExecutionToolResultBlockContentUnion
    Accepts one of the following:
    type BashCodeExecutionToolResultError struct{…}
    ErrorCode BashCodeExecutionToolResultErrorCode
    Accepts one of the following:
    const BashCodeExecutionToolResultErrorCodeInvalidToolInput BashCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const BashCodeExecutionToolResultErrorCodeUnavailable BashCodeExecutionToolResultErrorCode = "unavailable"
    const BashCodeExecutionToolResultErrorCodeTooManyRequests BashCodeExecutionToolResultErrorCode = "too_many_requests"
    const BashCodeExecutionToolResultErrorCodeExecutionTimeExceeded BashCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const BashCodeExecutionToolResultErrorCodeOutputFileTooLarge BashCodeExecutionToolResultErrorCode = "output_file_too_large"
    Type BashCodeExecutionToolResultError
    type BashCodeExecutionResultBlock struct{…}
    Content []BashCodeExecutionOutputBlock
    FileID string
    Type BashCodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type BashCodeExecutionResult
    ToolUseID string
    Type BashCodeExecutionToolResult
    type BashCodeExecutionToolResultBlockParamResp struct{…}
    Content BashCodeExecutionToolResultBlockParamContentUnionResp
    Accepts one of the following:
    type BashCodeExecutionToolResultErrorParamResp struct{…}
    ErrorCode BashCodeExecutionToolResultErrorCode
    Accepts one of the following:
    const BashCodeExecutionToolResultErrorCodeInvalidToolInput BashCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const BashCodeExecutionToolResultErrorCodeUnavailable BashCodeExecutionToolResultErrorCode = "unavailable"
    const BashCodeExecutionToolResultErrorCodeTooManyRequests BashCodeExecutionToolResultErrorCode = "too_many_requests"
    const BashCodeExecutionToolResultErrorCodeExecutionTimeExceeded BashCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const BashCodeExecutionToolResultErrorCodeOutputFileTooLarge BashCodeExecutionToolResultErrorCode = "output_file_too_large"
    Type BashCodeExecutionToolResultError
    type BashCodeExecutionResultBlockParamResp struct{…}
    Content []BashCodeExecutionOutputBlockParamResp
    FileID string
    Type BashCodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type BashCodeExecutionResult
    ToolUseID string
    Type BashCodeExecutionToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type BashCodeExecutionToolResultError struct{…}
    ErrorCode BashCodeExecutionToolResultErrorCode
    Accepts one of the following:
    const BashCodeExecutionToolResultErrorCodeInvalidToolInput BashCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const BashCodeExecutionToolResultErrorCodeUnavailable BashCodeExecutionToolResultErrorCode = "unavailable"
    const BashCodeExecutionToolResultErrorCodeTooManyRequests BashCodeExecutionToolResultErrorCode = "too_many_requests"
    const BashCodeExecutionToolResultErrorCodeExecutionTimeExceeded BashCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const BashCodeExecutionToolResultErrorCodeOutputFileTooLarge BashCodeExecutionToolResultErrorCode = "output_file_too_large"
    Type BashCodeExecutionToolResultError
    type BashCodeExecutionToolResultErrorCode string
    Accepts one of the following:
    const BashCodeExecutionToolResultErrorCodeInvalidToolInput BashCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const BashCodeExecutionToolResultErrorCodeUnavailable BashCodeExecutionToolResultErrorCode = "unavailable"
    const BashCodeExecutionToolResultErrorCodeTooManyRequests BashCodeExecutionToolResultErrorCode = "too_many_requests"
    const BashCodeExecutionToolResultErrorCodeExecutionTimeExceeded BashCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const BashCodeExecutionToolResultErrorCodeOutputFileTooLarge BashCodeExecutionToolResultErrorCode = "output_file_too_large"
    type BashCodeExecutionToolResultErrorParamResp struct{…}
    ErrorCode BashCodeExecutionToolResultErrorCode
    Accepts one of the following:
    const BashCodeExecutionToolResultErrorCodeInvalidToolInput BashCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const BashCodeExecutionToolResultErrorCodeUnavailable BashCodeExecutionToolResultErrorCode = "unavailable"
    const BashCodeExecutionToolResultErrorCodeTooManyRequests BashCodeExecutionToolResultErrorCode = "too_many_requests"
    const BashCodeExecutionToolResultErrorCodeExecutionTimeExceeded BashCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const BashCodeExecutionToolResultErrorCodeOutputFileTooLarge BashCodeExecutionToolResultErrorCode = "output_file_too_large"
    Type BashCodeExecutionToolResultError
    type CacheControlEphemeral struct{…}
    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type CacheCreation struct{…}
    Ephemeral1hInputTokens int64

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

    Ephemeral5mInputTokens int64

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

    type CitationCharLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    FileID string
    StartCharIndex int64
    Type CharLocation
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationContentBlockLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    FileID string
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationPageLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    FileID string
    StartPageNumber int64
    Type PageLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationsConfig struct{…}
    Enabled bool
    type CitationsConfigParamResp struct{…}
    Enabled booloptional
    type CitationsDelta struct{…}
    Citation CitationsDeltaCitationUnion
    Accepts one of the following:
    type CitationCharLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    FileID string
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    FileID string
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    FileID string
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationsWebSearchResultLocation struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationsSearchResultLocation struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    Type CitationsDelta
    type CitationsSearchResultLocation struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type CitationsWebSearchResultLocation struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CodeExecutionOutputBlock struct{…}
    FileID string
    Type CodeExecutionOutput
    type CodeExecutionOutputBlockParamResp struct{…}
    FileID string
    Type CodeExecutionOutput
    type CodeExecutionResultBlock struct{…}
    Content []CodeExecutionOutputBlock
    FileID string
    Type CodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type CodeExecutionResult
    type CodeExecutionResultBlockParamResp struct{…}
    Content []CodeExecutionOutputBlockParamResp
    FileID string
    Type CodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type CodeExecutionResult
    type CodeExecutionTool20250522 struct{…}
    Name CodeExecution

    Name of the tool.

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

    Type CodeExecution20250522
    AllowedCallers []stringoptional
    Accepts one of the following:
    const CodeExecutionTool20250522AllowedCallerDirect CodeExecutionTool20250522AllowedCaller = "direct"
    const CodeExecutionTool20250522AllowedCallerCodeExecution20250825 CodeExecutionTool20250522AllowedCaller = "code_execution_20250825"
    const CodeExecutionTool20250522AllowedCallerCodeExecution20260120 CodeExecutionTool20250522AllowedCaller = "code_execution_20260120"
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    DeferLoading booloptional

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

    Strict booloptional

    When true, guarantees schema validation on tool names and inputs

    type CodeExecutionTool20250825 struct{…}
    Name CodeExecution

    Name of the tool.

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

    Type CodeExecution20250825
    AllowedCallers []stringoptional
    Accepts one of the following:
    const CodeExecutionTool20250825AllowedCallerDirect CodeExecutionTool20250825AllowedCaller = "direct"
    const CodeExecutionTool20250825AllowedCallerCodeExecution20250825 CodeExecutionTool20250825AllowedCaller = "code_execution_20250825"
    const CodeExecutionTool20250825AllowedCallerCodeExecution20260120 CodeExecutionTool20250825AllowedCaller = "code_execution_20260120"
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    DeferLoading booloptional

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

    Strict booloptional

    When true, guarantees schema validation on tool names and inputs

    type CodeExecutionTool20260120 struct{…}

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

    Name CodeExecution

    Name of the tool.

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

    Type CodeExecution20260120
    AllowedCallers []stringoptional
    Accepts one of the following:
    const CodeExecutionTool20260120AllowedCallerDirect CodeExecutionTool20260120AllowedCaller = "direct"
    const CodeExecutionTool20260120AllowedCallerCodeExecution20250825 CodeExecutionTool20260120AllowedCaller = "code_execution_20250825"
    const CodeExecutionTool20260120AllowedCallerCodeExecution20260120 CodeExecutionTool20260120AllowedCaller = "code_execution_20260120"
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    DeferLoading booloptional

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

    Strict booloptional

    When true, guarantees schema validation on tool names and inputs

    type CodeExecutionToolResultBlock struct{…}
    Content CodeExecutionToolResultBlockContentUnion

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

    Accepts one of the following:
    type CodeExecutionToolResultError struct{…}
    ErrorCode CodeExecutionToolResultErrorCode
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    Type CodeExecutionToolResultError
    type CodeExecutionResultBlock struct{…}
    Content []CodeExecutionOutputBlock
    FileID string
    Type CodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type CodeExecutionResult
    type EncryptedCodeExecutionResultBlock struct{…}

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

    Content []CodeExecutionOutputBlock
    FileID string
    Type CodeExecutionOutput
    EncryptedStdout string
    ReturnCode int64
    Stderr string
    Type EncryptedCodeExecutionResult
    ToolUseID string
    Type CodeExecutionToolResult
    type CodeExecutionToolResultBlockContentUnion interface{…}

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

    Accepts one of the following:
    type CodeExecutionToolResultError struct{…}
    ErrorCode CodeExecutionToolResultErrorCode
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    Type CodeExecutionToolResultError
    type CodeExecutionResultBlock struct{…}
    Content []CodeExecutionOutputBlock
    FileID string
    Type CodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type CodeExecutionResult
    type EncryptedCodeExecutionResultBlock struct{…}

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

    Content []CodeExecutionOutputBlock
    FileID string
    Type CodeExecutionOutput
    EncryptedStdout string
    ReturnCode int64
    Stderr string
    Type EncryptedCodeExecutionResult
    type CodeExecutionToolResultBlockParamResp struct{…}
    Content CodeExecutionToolResultBlockParamContentUnionResp

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

    Accepts one of the following:
    type CodeExecutionToolResultErrorParamResp struct{…}
    ErrorCode CodeExecutionToolResultErrorCode
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    Type CodeExecutionToolResultError
    type CodeExecutionResultBlockParamResp struct{…}
    Content []CodeExecutionOutputBlockParamResp
    FileID string
    Type CodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type CodeExecutionResult
    type EncryptedCodeExecutionResultBlockParamResp struct{…}

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

    Content []CodeExecutionOutputBlockParamResp
    FileID string
    Type CodeExecutionOutput
    EncryptedStdout string
    ReturnCode int64
    Stderr string
    Type EncryptedCodeExecutionResult
    ToolUseID string
    Type CodeExecutionToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type CodeExecutionToolResultBlockParamContentUnionResp interface{…}

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

    Accepts one of the following:
    type CodeExecutionToolResultErrorParamResp struct{…}
    ErrorCode CodeExecutionToolResultErrorCode
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    Type CodeExecutionToolResultError
    type CodeExecutionResultBlockParamResp struct{…}
    Content []CodeExecutionOutputBlockParamResp
    FileID string
    Type CodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type CodeExecutionResult
    type EncryptedCodeExecutionResultBlockParamResp struct{…}

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

    Content []CodeExecutionOutputBlockParamResp
    FileID string
    Type CodeExecutionOutput
    EncryptedStdout string
    ReturnCode int64
    Stderr string
    Type EncryptedCodeExecutionResult
    type CodeExecutionToolResultError struct{…}
    ErrorCode CodeExecutionToolResultErrorCode
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    Type CodeExecutionToolResultError
    type CodeExecutionToolResultErrorCode string
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    type CodeExecutionToolResultErrorParamResp struct{…}
    ErrorCode CodeExecutionToolResultErrorCode
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    Type CodeExecutionToolResultError
    type Container struct{…}

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

    ID string

    Identifier for the container used in this request

    ExpiresAt Time

    The time at which the container will expire.

    type ContainerUploadBlock struct{…}

    Response model for a file uploaded to the container.

    FileID string
    Type ContainerUpload
    type ContainerUploadBlockParamResp struct{…}

    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.

    FileID string
    Type ContainerUpload
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type ContentBlockUnion interface{…}

    Response model for a file uploaded to the container.

    Accepts one of the following:
    type TextBlock struct{…}
    Citations []TextCitationUnion

    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:
    type CitationCharLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    FileID string
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    FileID string
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocation struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    FileID string
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationsWebSearchResultLocation struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationsSearchResultLocation struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    Text string
    Type Text
    type ThinkingBlock struct{…}
    Signature string
    Thinking string
    Type Thinking
    type RedactedThinkingBlock struct{…}
    Data string
    Type RedactedThinking
    type ToolUseBlock struct{…}
    ID string
    Caller ToolUseBlockCallerUnion

    Tool invocation directly from the model.

    Accepts one of the following:
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type ServerToolCaller struct{…}

    Tool invocation generated by a server-side tool.

    ToolID string
    Type CodeExecution20250825
    type ServerToolCaller20260120 struct{…}
    ToolID string
    Type CodeExecution20260120
    Input map[string, any]
    Name string
    Type ToolUse
    type ServerToolUseBlock struct{…}
    ID string
    Caller ServerToolUseBlockCallerUnion

    Tool invocation directly from the model.

    Accepts one of the following:
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type ServerToolCaller struct{…}

    Tool invocation generated by a server-side tool.

    ToolID string
    Type CodeExecution20250825
    type ServerToolCaller20260120 struct{…}
    ToolID string
    Type CodeExecution20260120
    Input map[string, any]
    Name ServerToolUseBlockName
    Accepts one of the following:
    const ServerToolUseBlockNameWebSearch ServerToolUseBlockName = "web_search"
    const ServerToolUseBlockNameWebFetch ServerToolUseBlockName = "web_fetch"
    const ServerToolUseBlockNameCodeExecution ServerToolUseBlockName = "code_execution"
    const ServerToolUseBlockNameBashCodeExecution ServerToolUseBlockName = "bash_code_execution"
    const ServerToolUseBlockNameTextEditorCodeExecution ServerToolUseBlockName = "text_editor_code_execution"
    const ServerToolUseBlockNameToolSearchToolRegex ServerToolUseBlockName = "tool_search_tool_regex"
    const ServerToolUseBlockNameToolSearchToolBm25 ServerToolUseBlockName = "tool_search_tool_bm25"
    Type ServerToolUse
    type WebSearchToolResultBlock struct{…}
    Caller WebSearchToolResultBlockCallerUnion

    Tool invocation directly from the model.

    Accepts one of the following:
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type ServerToolCaller struct{…}

    Tool invocation generated by a server-side tool.

    ToolID string
    Type CodeExecution20250825
    type ServerToolCaller20260120 struct{…}
    ToolID string
    Type CodeExecution20260120
    Content WebSearchToolResultBlockContentUnion
    Accepts one of the following:
    type WebSearchToolResultError struct{…}
    ErrorCode WebSearchToolResultErrorCode
    Accepts one of the following:
    const WebSearchToolResultErrorCodeInvalidToolInput WebSearchToolResultErrorCode = "invalid_tool_input"
    const WebSearchToolResultErrorCodeUnavailable WebSearchToolResultErrorCode = "unavailable"
    const WebSearchToolResultErrorCodeMaxUsesExceeded WebSearchToolResultErrorCode = "max_uses_exceeded"
    const WebSearchToolResultErrorCodeTooManyRequests WebSearchToolResultErrorCode = "too_many_requests"
    const WebSearchToolResultErrorCodeQueryTooLong WebSearchToolResultErrorCode = "query_too_long"
    const WebSearchToolResultErrorCodeRequestTooLarge WebSearchToolResultErrorCode = "request_too_large"
    Type WebSearchToolResultError
    type WebSearchToolResultBlockContentArray []WebSearchResultBlock
    EncryptedContent string
    PageAge string
    Title string
    Type WebSearchResult
    URL string
    ToolUseID string
    Type WebSearchToolResult
    type WebFetchToolResultBlock struct{…}
    Caller WebFetchToolResultBlockCallerUnion

    Tool invocation directly from the model.

    Accepts one of the following:
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type ServerToolCaller struct{…}

    Tool invocation generated by a server-side tool.

    ToolID string
    Type CodeExecution20250825
    type ServerToolCaller20260120 struct{…}
    ToolID string
    Type CodeExecution20260120
    Content WebFetchToolResultBlockContentUnion
    Accepts one of the following:
    type WebFetchToolResultErrorBlock struct{…}
    ErrorCode WebFetchToolResultErrorCode
    Accepts one of the following:
    const WebFetchToolResultErrorCodeInvalidToolInput WebFetchToolResultErrorCode = "invalid_tool_input"
    const WebFetchToolResultErrorCodeURLTooLong WebFetchToolResultErrorCode = "url_too_long"
    const WebFetchToolResultErrorCodeURLNotAllowed WebFetchToolResultErrorCode = "url_not_allowed"
    const WebFetchToolResultErrorCodeURLNotAccessible WebFetchToolResultErrorCode = "url_not_accessible"
    const WebFetchToolResultErrorCodeUnsupportedContentType WebFetchToolResultErrorCode = "unsupported_content_type"
    const WebFetchToolResultErrorCodeTooManyRequests WebFetchToolResultErrorCode = "too_many_requests"
    const WebFetchToolResultErrorCodeMaxUsesExceeded WebFetchToolResultErrorCode = "max_uses_exceeded"
    const WebFetchToolResultErrorCodeUnavailable WebFetchToolResultErrorCode = "unavailable"
    Type WebFetchToolResultError
    type WebFetchBlock struct{…}
    Content DocumentBlock
    Citations CitationsConfig

    Citation configuration for the document

    Enabled bool
    Source DocumentBlockSourceUnion
    Accepts one of the following:
    type Base64PDFSource struct{…}
    Data string
    MediaType ApplicationPDF
    Type Base64
    type PlainTextSource struct{…}
    Data string
    MediaType TextPlain
    Type Text
    Title string

    The title of the document

    Type Document
    RetrievedAt string

    ISO 8601 timestamp when the content was retrieved

    Type WebFetchResult
    URL string

    Fetched content URL

    ToolUseID string
    Type WebFetchToolResult
    type CodeExecutionToolResultBlock struct{…}
    Content CodeExecutionToolResultBlockContentUnion

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

    Accepts one of the following:
    type CodeExecutionToolResultError struct{…}
    ErrorCode CodeExecutionToolResultErrorCode
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    Type CodeExecutionToolResultError
    type CodeExecutionResultBlock struct{…}
    Content []CodeExecutionOutputBlock
    FileID string
    Type CodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type CodeExecutionResult
    type EncryptedCodeExecutionResultBlock struct{…}

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

    Content []CodeExecutionOutputBlock
    FileID string
    Type CodeExecutionOutput
    EncryptedStdout string
    ReturnCode int64
    Stderr string
    Type EncryptedCodeExecutionResult
    ToolUseID string
    Type CodeExecutionToolResult
    type BashCodeExecutionToolResultBlock struct{…}
    Content BashCodeExecutionToolResultBlockContentUnion
    Accepts one of the following:
    type BashCodeExecutionToolResultError struct{…}
    ErrorCode BashCodeExecutionToolResultErrorCode
    Accepts one of the following:
    const BashCodeExecutionToolResultErrorCodeInvalidToolInput BashCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const BashCodeExecutionToolResultErrorCodeUnavailable BashCodeExecutionToolResultErrorCode = "unavailable"
    const BashCodeExecutionToolResultErrorCodeTooManyRequests BashCodeExecutionToolResultErrorCode = "too_many_requests"
    const BashCodeExecutionToolResultErrorCodeExecutionTimeExceeded BashCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const BashCodeExecutionToolResultErrorCodeOutputFileTooLarge BashCodeExecutionToolResultErrorCode = "output_file_too_large"
    Type BashCodeExecutionToolResultError
    type BashCodeExecutionResultBlock struct{…}
    Content []BashCodeExecutionOutputBlock
    FileID string
    Type BashCodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type BashCodeExecutionResult
    ToolUseID string
    Type BashCodeExecutionToolResult
    type TextEditorCodeExecutionToolResultBlock struct{…}
    Content TextEditorCodeExecutionToolResultBlockContentUnion
    Accepts one of the following:
    type TextEditorCodeExecutionToolResultError struct{…}
    ErrorCode TextEditorCodeExecutionToolResultErrorCode
    Accepts one of the following:
    const TextEditorCodeExecutionToolResultErrorCodeInvalidToolInput TextEditorCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const TextEditorCodeExecutionToolResultErrorCodeUnavailable TextEditorCodeExecutionToolResultErrorCode = "unavailable"
    const TextEditorCodeExecutionToolResultErrorCodeTooManyRequests TextEditorCodeExecutionToolResultErrorCode = "too_many_requests"
    const TextEditorCodeExecutionToolResultErrorCodeExecutionTimeExceeded TextEditorCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const TextEditorCodeExecutionToolResultErrorCodeFileNotFound TextEditorCodeExecutionToolResultErrorCode = "file_not_found"
    ErrorMessage string
    Type TextEditorCodeExecutionToolResultError
    type TextEditorCodeExecutionViewResultBlock struct{…}
    Content string
    FileType TextEditorCodeExecutionViewResultBlockFileType
    Accepts one of the following:
    const TextEditorCodeExecutionViewResultBlockFileTypeText TextEditorCodeExecutionViewResultBlockFileType = "text"
    const TextEditorCodeExecutionViewResultBlockFileTypeImage TextEditorCodeExecutionViewResultBlockFileType = "image"
    const TextEditorCodeExecutionViewResultBlockFileTypePDF TextEditorCodeExecutionViewResultBlockFileType = "pdf"
    NumLines int64
    StartLine int64
    TotalLines int64
    Type TextEditorCodeExecutionViewResult
    type TextEditorCodeExecutionCreateResultBlock struct{…}
    IsFileUpdate bool
    Type TextEditorCodeExecutionCreateResult
    type TextEditorCodeExecutionStrReplaceResultBlock struct{…}
    Lines []string
    NewLines int64
    NewStart int64
    OldLines int64
    OldStart int64
    Type TextEditorCodeExecutionStrReplaceResult
    ToolUseID string
    Type TextEditorCodeExecutionToolResult
    type ToolSearchToolResultBlock struct{…}
    Content ToolSearchToolResultBlockContentUnion
    Accepts one of the following:
    type ToolSearchToolResultError struct{…}
    ErrorCode ToolSearchToolResultErrorCode
    Accepts one of the following:
    const ToolSearchToolResultErrorCodeInvalidToolInput ToolSearchToolResultErrorCode = "invalid_tool_input"
    const ToolSearchToolResultErrorCodeUnavailable ToolSearchToolResultErrorCode = "unavailable"
    const ToolSearchToolResultErrorCodeTooManyRequests ToolSearchToolResultErrorCode = "too_many_requests"
    const ToolSearchToolResultErrorCodeExecutionTimeExceeded ToolSearchToolResultErrorCode = "execution_time_exceeded"
    ErrorMessage string
    Type ToolSearchToolResultError
    type ToolSearchToolSearchResultBlock struct{…}
    ToolReferences []ToolReferenceBlock
    ToolName string
    Type ToolReference
    Type ToolSearchToolSearchResult
    ToolUseID string
    Type ToolSearchToolResult
    type ContainerUploadBlock struct{…}

    Response model for a file uploaded to the container.

    FileID string
    Type ContainerUpload
    type ContentBlockParamUnionResp interface{…}

    Regular text content.

    Accepts one of the following:
    type TextBlockParamResp struct{…}
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type ImageBlockParamResp struct{…}
    Source ImageBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type URLImageSource struct{…}
    Type URL
    URL string
    Type Image
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type DocumentBlockParamResp struct{…}
    Source DocumentBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64PDFSource struct{…}
    Data string
    MediaType ApplicationPDF
    Type Base64
    type PlainTextSource struct{…}
    Data string
    MediaType TextPlain
    Type Text
    type ContentBlockSource struct{…}
    Content ContentBlockSourceContentUnion
    Accepts one of the following:
    string
    []ContentBlockSourceContentItemUnion
    Accepts one of the following:
    type TextBlockParamResp struct{…}
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type ImageBlockParamResp struct{…}
    Source ImageBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type URLImageSource struct{…}
    Type URL
    URL string
    Type Image
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Type Content
    type URLPDFSource struct{…}
    Type URL
    URL string
    Type Document
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations CitationsConfigParamRespoptional
    Enabled booloptional
    Context stringoptional
    Title stringoptional
    type SearchResultBlockParamResp struct{…}
    Content []TextBlockParamResp
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    Source string
    Title string
    Type SearchResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations CitationsConfigParamRespoptional
    Enabled booloptional
    type ThinkingBlockParamResp struct{…}
    Signature string
    Thinking string
    Type Thinking
    type RedactedThinkingBlockParamResp struct{…}
    Data string
    Type RedactedThinking
    type ToolUseBlockParamResp struct{…}
    ID string
    Input map[string, any]
    Name string
    Type ToolUse
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Caller ToolUseBlockParamCallerUnionRespoptional

    Tool invocation directly from the model.

    Accepts one of the following:
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type ServerToolCaller struct{…}

    Tool invocation generated by a server-side tool.

    ToolID string
    Type CodeExecution20250825
    type ServerToolCaller20260120 struct{…}
    ToolID string
    Type CodeExecution20260120
    type ToolResultBlockParamResp struct{…}
    ToolUseID string
    Type ToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Content []ToolResultBlockParamContentUnionRespoptional
    Accepts one of the following:
    []ToolResultBlockParamContentUnionResp
    Accepts one of the following:
    type TextBlockParamResp struct{…}
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type ImageBlockParamResp struct{…}
    Source ImageBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type URLImageSource struct{…}
    Type URL
    URL string
    Type Image
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type SearchResultBlockParamResp struct{…}
    Content []TextBlockParamResp
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    Source string
    Title string
    Type SearchResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations CitationsConfigParamRespoptional
    Enabled booloptional
    type DocumentBlockParamResp struct{…}
    Source DocumentBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64PDFSource struct{…}
    Data string
    MediaType ApplicationPDF
    Type Base64
    type PlainTextSource struct{…}
    Data string
    MediaType TextPlain
    Type Text
    type ContentBlockSource struct{…}
    Content ContentBlockSourceContentUnion
    Accepts one of the following:
    string
    []ContentBlockSourceContentItemUnion
    Accepts one of the following:
    type TextBlockParamResp struct{…}
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type ImageBlockParamResp struct{…}
    Source ImageBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type URLImageSource struct{…}
    Type URL
    URL string
    Type Image
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Type Content
    type URLPDFSource struct{…}
    Type URL
    URL string
    Type Document
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations CitationsConfigParamRespoptional
    Enabled booloptional
    Context stringoptional
    Title stringoptional
    type ToolReferenceBlockParamResp struct{…}

    Tool reference block that can be included in tool_result content.

    ToolName string
    Type ToolReference
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    IsError booloptional
    type ServerToolUseBlockParamResp struct{…}
    ID string
    Input map[string, any]
    Name ServerToolUseBlockParamName
    Accepts one of the following:
    const ServerToolUseBlockParamNameWebSearch ServerToolUseBlockParamName = "web_search"
    const ServerToolUseBlockParamNameWebFetch ServerToolUseBlockParamName = "web_fetch"
    const ServerToolUseBlockParamNameCodeExecution ServerToolUseBlockParamName = "code_execution"
    const ServerToolUseBlockParamNameBashCodeExecution ServerToolUseBlockParamName = "bash_code_execution"
    const ServerToolUseBlockParamNameTextEditorCodeExecution ServerToolUseBlockParamName = "text_editor_code_execution"
    const ServerToolUseBlockParamNameToolSearchToolRegex ServerToolUseBlockParamName = "tool_search_tool_regex"
    const ServerToolUseBlockParamNameToolSearchToolBm25 ServerToolUseBlockParamName = "tool_search_tool_bm25"
    Type ServerToolUse
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Caller ServerToolUseBlockParamCallerUnionRespoptional

    Tool invocation directly from the model.

    Accepts one of the following:
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type ServerToolCaller struct{…}

    Tool invocation generated by a server-side tool.

    ToolID string
    Type CodeExecution20250825
    type ServerToolCaller20260120 struct{…}
    ToolID string
    Type CodeExecution20260120
    type WebSearchToolResultBlockParamResp struct{…}
    Content WebSearchToolResultBlockParamContentUnionResp
    Accepts one of the following:
    []WebSearchResultBlockParamResp
    EncryptedContent string
    Title string
    Type WebSearchResult
    URL string
    PageAge stringoptional
    type WebSearchToolRequestError struct{…}
    ErrorCode WebSearchToolResultErrorCode
    Accepts one of the following:
    const WebSearchToolResultErrorCodeInvalidToolInput WebSearchToolResultErrorCode = "invalid_tool_input"
    const WebSearchToolResultErrorCodeUnavailable WebSearchToolResultErrorCode = "unavailable"
    const WebSearchToolResultErrorCodeMaxUsesExceeded WebSearchToolResultErrorCode = "max_uses_exceeded"
    const WebSearchToolResultErrorCodeTooManyRequests WebSearchToolResultErrorCode = "too_many_requests"
    const WebSearchToolResultErrorCodeQueryTooLong WebSearchToolResultErrorCode = "query_too_long"
    const WebSearchToolResultErrorCodeRequestTooLarge WebSearchToolResultErrorCode = "request_too_large"
    Type WebSearchToolResultError
    ToolUseID string
    Type WebSearchToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Caller WebSearchToolResultBlockParamCallerUnionRespoptional

    Tool invocation directly from the model.

    Accepts one of the following:
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type ServerToolCaller struct{…}

    Tool invocation generated by a server-side tool.

    ToolID string
    Type CodeExecution20250825
    type ServerToolCaller20260120 struct{…}
    ToolID string
    Type CodeExecution20260120
    type WebFetchToolResultBlockParamResp struct{…}
    Content WebFetchToolResultBlockParamContentUnionResp
    Accepts one of the following:
    type WebFetchToolResultErrorBlockParamResp struct{…}
    ErrorCode WebFetchToolResultErrorCode
    Accepts one of the following:
    const WebFetchToolResultErrorCodeInvalidToolInput WebFetchToolResultErrorCode = "invalid_tool_input"
    const WebFetchToolResultErrorCodeURLTooLong WebFetchToolResultErrorCode = "url_too_long"
    const WebFetchToolResultErrorCodeURLNotAllowed WebFetchToolResultErrorCode = "url_not_allowed"
    const WebFetchToolResultErrorCodeURLNotAccessible WebFetchToolResultErrorCode = "url_not_accessible"
    const WebFetchToolResultErrorCodeUnsupportedContentType WebFetchToolResultErrorCode = "unsupported_content_type"
    const WebFetchToolResultErrorCodeTooManyRequests WebFetchToolResultErrorCode = "too_many_requests"
    const WebFetchToolResultErrorCodeMaxUsesExceeded WebFetchToolResultErrorCode = "max_uses_exceeded"
    const WebFetchToolResultErrorCodeUnavailable WebFetchToolResultErrorCode = "unavailable"
    Type WebFetchToolResultError
    type WebFetchBlockParamResp struct{…}
    Content DocumentBlockParamResp
    Source DocumentBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64PDFSource struct{…}
    Data string
    MediaType ApplicationPDF
    Type Base64
    type PlainTextSource struct{…}
    Data string
    MediaType TextPlain
    Type Text
    type ContentBlockSource struct{…}
    Content ContentBlockSourceContentUnion
    Accepts one of the following:
    string
    []ContentBlockSourceContentItemUnion
    Accepts one of the following:
    type TextBlockParamResp struct{…}
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type ImageBlockParamResp struct{…}
    Source ImageBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type URLImageSource struct{…}
    Type URL
    URL string
    Type Image
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Type Content
    type URLPDFSource struct{…}
    Type URL
    URL string
    Type Document
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations CitationsConfigParamRespoptional
    Enabled booloptional
    Context stringoptional
    Title stringoptional
    Type WebFetchResult
    URL string

    Fetched content URL

    RetrievedAt stringoptional

    ISO 8601 timestamp when the content was retrieved

    ToolUseID string
    Type WebFetchToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Caller WebFetchToolResultBlockParamCallerUnionRespoptional

    Tool invocation directly from the model.

    Accepts one of the following:
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type ServerToolCaller struct{…}

    Tool invocation generated by a server-side tool.

    ToolID string
    Type CodeExecution20250825
    type ServerToolCaller20260120 struct{…}
    ToolID string
    Type CodeExecution20260120
    type CodeExecutionToolResultBlockParamResp struct{…}
    Content CodeExecutionToolResultBlockParamContentUnionResp

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

    Accepts one of the following:
    type CodeExecutionToolResultErrorParamResp struct{…}
    ErrorCode CodeExecutionToolResultErrorCode
    Accepts one of the following:
    const CodeExecutionToolResultErrorCodeInvalidToolInput CodeExecutionToolResultErrorCode = "invalid_tool_input"
    const CodeExecutionToolResultErrorCodeUnavailable CodeExecutionToolResultErrorCode = "unavailable"
    const CodeExecutionToolResultErrorCodeTooManyRequests CodeExecutionToolResultErrorCode = "too_many_requests"
    const CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
    Type CodeExecutionToolResultError
    type CodeExecutionResultBlockParamResp struct{…}
    Content []CodeExecutionOutputBlockParamResp
    FileID string
    Type CodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type CodeExecutionResult
    type EncryptedCodeExecutionResultBlockParamResp struct{…}

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

    Content []CodeExecutionOutputBlockParamResp
    FileID string
    Type CodeExecutionOutput
    EncryptedStdout string
    ReturnCode int64
    Stderr string
    Type EncryptedCodeExecutionResult
    ToolUseID string
    Type CodeExecutionToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type BashCodeExecutionToolResultBlockParamResp struct{…}
    Content BashCodeExecutionToolResultBlockParamContentUnionResp
    Accepts one of the following:
    type BashCodeExecutionToolResultErrorParamResp struct{…}
    ErrorCode BashCodeExecutionToolResultErrorCode
    Accepts one of the following:
    const BashCodeExecutionToolResultErrorCodeInvalidToolInput BashCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const BashCodeExecutionToolResultErrorCodeUnavailable BashCodeExecutionToolResultErrorCode = "unavailable"
    const BashCodeExecutionToolResultErrorCodeTooManyRequests BashCodeExecutionToolResultErrorCode = "too_many_requests"
    const BashCodeExecutionToolResultErrorCodeExecutionTimeExceeded BashCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const BashCodeExecutionToolResultErrorCodeOutputFileTooLarge BashCodeExecutionToolResultErrorCode = "output_file_too_large"
    Type BashCodeExecutionToolResultError
    type BashCodeExecutionResultBlockParamResp struct{…}
    Content []BashCodeExecutionOutputBlockParamResp
    FileID string
    Type BashCodeExecutionOutput
    ReturnCode int64
    Stderr string
    Stdout string
    Type BashCodeExecutionResult
    ToolUseID string
    Type BashCodeExecutionToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type TextEditorCodeExecutionToolResultBlockParamResp struct{…}
    Content TextEditorCodeExecutionToolResultBlockParamContentUnionResp
    Accepts one of the following:
    type TextEditorCodeExecutionToolResultErrorParamResp struct{…}
    ErrorCode TextEditorCodeExecutionToolResultErrorCode
    Accepts one of the following:
    const TextEditorCodeExecutionToolResultErrorCodeInvalidToolInput TextEditorCodeExecutionToolResultErrorCode = "invalid_tool_input"
    const TextEditorCodeExecutionToolResultErrorCodeUnavailable TextEditorCodeExecutionToolResultErrorCode = "unavailable"
    const TextEditorCodeExecutionToolResultErrorCodeTooManyRequests TextEditorCodeExecutionToolResultErrorCode = "too_many_requests"
    const TextEditorCodeExecutionToolResultErrorCodeExecutionTimeExceeded TextEditorCodeExecutionToolResultErrorCode = "execution_time_exceeded"
    const TextEditorCodeExecutionToolResultErrorCodeFileNotFound TextEditorCodeExecutionToolResultErrorCode = "file_not_found"
    Type TextEditorCodeExecutionToolResultError
    ErrorMessage stringoptional
    type TextEditorCodeExecutionViewResultBlockParamResp struct{…}
    Content string
    FileType TextEditorCodeExecutionViewResultBlockParamFileType
    Accepts one of the following:
    const TextEditorCodeExecutionViewResultBlockParamFileTypeText TextEditorCodeExecutionViewResultBlockParamFileType = "text"
    const TextEditorCodeExecutionViewResultBlockParamFileTypeImage TextEditorCodeExecutionViewResultBlockParamFileType = "image"
    const TextEditorCodeExecutionViewResultBlockParamFileTypePDF TextEditorCodeExecutionViewResultBlockParamFileType = "pdf"
    Type TextEditorCodeExecutionViewResult
    NumLines int64optional
    StartLine int64optional
    TotalLines int64optional
    type TextEditorCodeExecutionCreateResultBlockParamResp struct{…}
    IsFileUpdate bool
    Type TextEditorCodeExecutionCreateResult
    type TextEditorCodeExecutionStrReplaceResultBlockParamResp struct{…}
    Type TextEditorCodeExecutionStrReplaceResult
    Lines []stringoptional
    NewLines int64optional
    NewStart int64optional
    OldLines int64optional
    OldStart int64optional
    ToolUseID string
    Type TextEditorCodeExecutionToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type ToolSearchToolResultBlockParamResp struct{…}
    Content ToolSearchToolResultBlockParamContentUnionResp
    Accepts one of the following:
    type ToolSearchToolResultErrorParamResp struct{…}
    ErrorCode ToolSearchToolResultErrorCode
    Accepts one of the following:
    const ToolSearchToolResultErrorCodeInvalidToolInput ToolSearchToolResultErrorCode = "invalid_tool_input"
    const ToolSearchToolResultErrorCodeUnavailable ToolSearchToolResultErrorCode = "unavailable"
    const ToolSearchToolResultErrorCodeTooManyRequests ToolSearchToolResultErrorCode = "too_many_requests"
    const ToolSearchToolResultErrorCodeExecutionTimeExceeded ToolSearchToolResultErrorCode = "execution_time_exceeded"
    Type ToolSearchToolResultError
    type ToolSearchToolSearchResultBlockParamResp struct{…}
    ToolReferences []ToolReferenceBlockParamResp
    ToolName string
    Type ToolReference
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Type ToolSearchToolSearchResult
    ToolUseID string
    Type ToolSearchToolResult
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type ContainerUploadBlockParamResp struct{…}

    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.

    FileID string
    Type ContainerUpload
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type ContentBlockSource struct{…}
    Content ContentBlockSourceContentUnion
    Accepts one of the following:
    string
    []ContentBlockSourceContentItemUnion
    Accepts one of the following:
    type TextBlockParamResp struct{…}
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type ImageBlockParamResp struct{…}
    Source ImageBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type URLImageSource struct{…}
    Type URL
    URL string
    Type Image
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Type Content
    type ContentBlockSourceContentItemUnion interface{…}
    Accepts one of the following:
    type TextBlockParamResp struct{…}
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type ImageBlockParamResp struct{…}
    Source ImageBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type URLImageSource struct{…}
    Type URL
    URL string
    Type Image
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    type DirectCaller struct{…}

    Tool invocation directly from the model.

    Type Direct
    type DocumentBlock struct{…}
    Citations CitationsConfig

    Citation configuration for the document

    Enabled bool
    Source DocumentBlockSourceUnion
    Accepts one of the following:
    type Base64PDFSource struct{…}
    Data string
    MediaType ApplicationPDF
    Type Base64
    type PlainTextSource struct{…}
    Data string
    MediaType TextPlain
    Type Text
    Title string

    The title of the document

    Type Document
    type DocumentBlockParamResp struct{…}
    Source DocumentBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64PDFSource struct{…}
    Data string
    MediaType ApplicationPDF
    Type Base64
    type PlainTextSource struct{…}
    Data string
    MediaType TextPlain
    Type Text
    type ContentBlockSource struct{…}
    Content ContentBlockSourceContentUnion
    Accepts one of the following:
    string
    []ContentBlockSourceContentItemUnion
    Accepts one of the following:
    type TextBlockParamResp struct{…}
    Text string
    Type Text
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations []TextCitationParamUnionRespoptional
    Accepts one of the following:
    type CitationCharLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndCharIndex int64
    StartCharIndex int64
    Type CharLocation
    type CitationPageLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndPageNumber int64
    StartPageNumber int64
    Type PageLocation
    type CitationContentBlockLocationParamResp struct{…}
    CitedText string
    DocumentIndex int64
    DocumentTitle string
    EndBlockIndex int64
    StartBlockIndex int64
    Type ContentBlockLocation
    type CitationWebSearchResultLocationParamResp struct{…}
    CitedText string
    EncryptedIndex string
    Title string
    Type WebSearchResultLocation
    URL string
    type CitationSearchResultLocationParamResp struct{…}
    CitedText string
    EndBlockIndex int64
    SearchResultIndex int64
    Source string
    StartBlockIndex int64
    Title string
    Type SearchResultLocation
    type ImageBlockParamResp struct{…}
    Source ImageBlockParamSourceUnionResp
    Accepts one of the following:
    type Base64ImageSource struct{…}
    Data string
    MediaType Base64ImageSourceMediaType
    Accepts one of the following:
    const Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
    const Base64ImageSourceMediaTypeImagePNG Base64ImageSourceMediaType = "image/png"
    const Base64ImageSourceMediaTypeImageGIF Base64ImageSourceMediaType = "image/gif"
    const Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
    Type Base64
    type URLImageSource struct{…}
    Type URL
    URL string
    Type Image
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Type Content
    type URLPDFSource struct{…}
    Type URL
    URL string
    Type Document
    CacheControl CacheControlEphemeraloptional

    Create a cache control breakpoint at this content block.

    Type Ephemeral
    TTL CacheControlEphemeralTTLoptional

    The 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:
    const CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
    const CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
    Citations CitationsConfigParamRespoptional
    Enabled booloptional
    Context stringoptional
    Title stringoptional
    type EncryptedCodeExecutionResultBlock struct{…}