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
    Message messages().create(MessageCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
    POST/v1/messages
    Count tokens in a Message
    MessageTokensCount messages().countTokens(MessageCountTokensParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
    POST/v1/messages/count_tokens
    ModelsExpand Collapse
    class Base64ImageSource:
    String data
    MediaType mediaType
    Accepts one of the following:
    IMAGE_JPEG("image/jpeg")
    IMAGE_PNG("image/png")
    IMAGE_GIF("image/gif")
    IMAGE_WEBP("image/webp")
    JsonValue; type "base64"constant"base64"constant
    class Base64PdfSource:
    String data
    JsonValue; mediaType "application/pdf"constant"application/pdf"constant
    JsonValue; type "base64"constant"base64"constant
    class BashCodeExecutionOutputBlock:
    String fileId
    JsonValue; type "bash_code_execution_output"constant"bash_code_execution_output"constant
    class BashCodeExecutionOutputBlockParam:
    String fileId
    JsonValue; type "bash_code_execution_output"constant"bash_code_execution_output"constant
    class BashCodeExecutionResultBlock:
    List<BashCodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "bash_code_execution_output"constant"bash_code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "bash_code_execution_result"constant"bash_code_execution_result"constant
    class BashCodeExecutionResultBlockParam:
    List<BashCodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "bash_code_execution_output"constant"bash_code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "bash_code_execution_result"constant"bash_code_execution_result"constant
    class BashCodeExecutionToolResultBlock:
    Content content
    Accepts one of the following:
    class BashCodeExecutionToolResultError:
    BashCodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    OUTPUT_FILE_TOO_LARGE("output_file_too_large")
    JsonValue; type "bash_code_execution_tool_result_error"constant"bash_code_execution_tool_result_error"constant
    class BashCodeExecutionResultBlock:
    List<BashCodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "bash_code_execution_output"constant"bash_code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "bash_code_execution_result"constant"bash_code_execution_result"constant
    String toolUseId
    JsonValue; type "bash_code_execution_tool_result"constant"bash_code_execution_tool_result"constant
    class BashCodeExecutionToolResultBlockParam:
    Content content
    Accepts one of the following:
    class BashCodeExecutionToolResultErrorParam:
    BashCodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    OUTPUT_FILE_TOO_LARGE("output_file_too_large")
    JsonValue; type "bash_code_execution_tool_result_error"constant"bash_code_execution_tool_result_error"constant
    class BashCodeExecutionResultBlockParam:
    List<BashCodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "bash_code_execution_output"constant"bash_code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "bash_code_execution_result"constant"bash_code_execution_result"constant
    String toolUseId
    JsonValue; type "bash_code_execution_tool_result"constant"bash_code_execution_tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class BashCodeExecutionToolResultError:
    BashCodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    OUTPUT_FILE_TOO_LARGE("output_file_too_large")
    JsonValue; type "bash_code_execution_tool_result_error"constant"bash_code_execution_tool_result_error"constant
    enum BashCodeExecutionToolResultErrorCode:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    OUTPUT_FILE_TOO_LARGE("output_file_too_large")
    class BashCodeExecutionToolResultErrorParam:
    BashCodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    OUTPUT_FILE_TOO_LARGE("output_file_too_large")
    JsonValue; type "bash_code_execution_tool_result_error"constant"bash_code_execution_tool_result_error"constant
    class CacheControlEphemeral:
    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class CacheCreation:
    long ephemeral1hInputTokens

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

    long ephemeral5mInputTokens

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

    class CitationCharLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    Optional<String> fileId
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationContentBlockLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    Optional<String> fileId
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationPageLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    Optional<String> fileId
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationsConfig:
    boolean enabled
    class CitationsConfigParam:
    Optional<Boolean> enabled
    class CitationsDelta:
    Citation citation
    Accepts one of the following:
    class CitationCharLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    Optional<String> fileId
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    Optional<String> fileId
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    Optional<String> fileId
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationsWebSearchResultLocation:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationsSearchResultLocation:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    JsonValue; type "citations_delta"constant"citations_delta"constant
    class CitationsSearchResultLocation:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class CitationsWebSearchResultLocation:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CodeExecutionOutputBlock:
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    class CodeExecutionOutputBlockParam:
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    class CodeExecutionResultBlock:
    List<CodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "code_execution_result"constant"code_execution_result"constant
    class CodeExecutionResultBlockParam:
    List<CodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "code_execution_result"constant"code_execution_result"constant
    class CodeExecutionTool20250522:
    JsonValue; name "code_execution"constant"code_execution"constant

    Name of the tool.

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

    JsonValue; type "code_execution_20250522"constant"code_execution_20250522"constant
    Optional<List<AllowedCaller>> allowedCallers
    Accepts one of the following:
    DIRECT("direct")
    CODE_EXECUTION_20250825("code_execution_20250825")
    CODE_EXECUTION_20260120("code_execution_20260120")
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Boolean> deferLoading

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

    Optional<Boolean> strict

    When true, guarantees schema validation on tool names and inputs

    class CodeExecutionTool20250825:
    JsonValue; name "code_execution"constant"code_execution"constant

    Name of the tool.

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

    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    Optional<List<AllowedCaller>> allowedCallers
    Accepts one of the following:
    DIRECT("direct")
    CODE_EXECUTION_20250825("code_execution_20250825")
    CODE_EXECUTION_20260120("code_execution_20260120")
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Boolean> deferLoading

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

    Optional<Boolean> strict

    When true, guarantees schema validation on tool names and inputs

    class CodeExecutionTool20260120:

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

    JsonValue; name "code_execution"constant"code_execution"constant

    Name of the tool.

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

    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    Optional<List<AllowedCaller>> allowedCallers
    Accepts one of the following:
    DIRECT("direct")
    CODE_EXECUTION_20250825("code_execution_20250825")
    CODE_EXECUTION_20260120("code_execution_20260120")
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Boolean> deferLoading

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

    Optional<Boolean> strict

    When true, guarantees schema validation on tool names and inputs

    class CodeExecutionToolResultBlock:
    CodeExecutionToolResultBlockContent content

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

    Accepts one of the following:
    class CodeExecutionToolResultError:
    CodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "code_execution_tool_result_error"constant"code_execution_tool_result_error"constant
    class CodeExecutionResultBlock:
    List<CodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "code_execution_result"constant"code_execution_result"constant
    class EncryptedCodeExecutionResultBlock:

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

    List<CodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    String encryptedStdout
    long returnCode
    String stderr
    JsonValue; type "encrypted_code_execution_result"constant"encrypted_code_execution_result"constant
    String toolUseId
    JsonValue; type "code_execution_tool_result"constant"code_execution_tool_result"constant
    class CodeExecutionToolResultBlockContent: A class that can be one of several variants.union

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

    class CodeExecutionToolResultError:
    CodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "code_execution_tool_result_error"constant"code_execution_tool_result_error"constant
    class CodeExecutionResultBlock:
    List<CodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "code_execution_result"constant"code_execution_result"constant
    class EncryptedCodeExecutionResultBlock:

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

    List<CodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    String encryptedStdout
    long returnCode
    String stderr
    JsonValue; type "encrypted_code_execution_result"constant"encrypted_code_execution_result"constant
    class CodeExecutionToolResultBlockParam:
    CodeExecutionToolResultBlockParamContent content

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

    Accepts one of the following:
    class CodeExecutionToolResultErrorParam:
    CodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "code_execution_tool_result_error"constant"code_execution_tool_result_error"constant
    class CodeExecutionResultBlockParam:
    List<CodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "code_execution_result"constant"code_execution_result"constant
    class EncryptedCodeExecutionResultBlockParam:

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

    List<CodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    String encryptedStdout
    long returnCode
    String stderr
    JsonValue; type "encrypted_code_execution_result"constant"encrypted_code_execution_result"constant
    String toolUseId
    JsonValue; type "code_execution_tool_result"constant"code_execution_tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class CodeExecutionToolResultBlockParamContent: A class that can be one of several variants.union

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

    class CodeExecutionToolResultErrorParam:
    CodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "code_execution_tool_result_error"constant"code_execution_tool_result_error"constant
    class CodeExecutionResultBlockParam:
    List<CodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "code_execution_result"constant"code_execution_result"constant
    class EncryptedCodeExecutionResultBlockParam:

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

    List<CodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    String encryptedStdout
    long returnCode
    String stderr
    JsonValue; type "encrypted_code_execution_result"constant"encrypted_code_execution_result"constant
    class CodeExecutionToolResultError:
    CodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "code_execution_tool_result_error"constant"code_execution_tool_result_error"constant
    enum CodeExecutionToolResultErrorCode:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    class CodeExecutionToolResultErrorParam:
    CodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "code_execution_tool_result_error"constant"code_execution_tool_result_error"constant
    class Container:

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

    String id

    Identifier for the container used in this request

    LocalDateTime expiresAt

    The time at which the container will expire.

    class ContainerUploadBlock:

    Response model for a file uploaded to the container.

    String fileId
    JsonValue; type "container_upload"constant"container_upload"constant
    class ContainerUploadBlockParam:

    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.

    String fileId
    JsonValue; type "container_upload"constant"container_upload"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class ContentBlock: A class that can be one of several variants.union

    Response model for a file uploaded to the container.

    class TextBlock:
    Optional<List<TextCitation>> 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 CitationCharLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    Optional<String> fileId
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    Optional<String> fileId
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocation:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    Optional<String> fileId
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationsWebSearchResultLocation:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationsSearchResultLocation:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    String text
    JsonValue; type "text"constant"text"constant
    class ThinkingBlock:
    String signature
    String thinking
    JsonValue; type "thinking"constant"thinking"constant
    class RedactedThinkingBlock:
    String data
    JsonValue; type "redacted_thinking"constant"redacted_thinking"constant
    class ToolUseBlock:
    String id
    Caller caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class ServerToolCaller:

    Tool invocation generated by a server-side tool.

    String toolId
    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    class ServerToolCaller20260120:
    String toolId
    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    Input input
    String name
    JsonValue; type "tool_use"constant"tool_use"constant
    class ServerToolUseBlock:
    String id
    Caller caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class ServerToolCaller:

    Tool invocation generated by a server-side tool.

    String toolId
    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    class ServerToolCaller20260120:
    String toolId
    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    Input input
    Name name
    Accepts one of the following:
    WEB_SEARCH("web_search")
    WEB_FETCH("web_fetch")
    CODE_EXECUTION("code_execution")
    BASH_CODE_EXECUTION("bash_code_execution")
    TEXT_EDITOR_CODE_EXECUTION("text_editor_code_execution")
    TOOL_SEARCH_TOOL_REGEX("tool_search_tool_regex")
    TOOL_SEARCH_TOOL_BM25("tool_search_tool_bm25")
    JsonValue; type "server_tool_use"constant"server_tool_use"constant
    class WebSearchToolResultBlock:
    Caller caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class ServerToolCaller:

    Tool invocation generated by a server-side tool.

    String toolId
    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    class ServerToolCaller20260120:
    String toolId
    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    WebSearchToolResultBlockContent content
    Accepts one of the following:
    class WebSearchToolResultError:
    WebSearchToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    MAX_USES_EXCEEDED("max_uses_exceeded")
    TOO_MANY_REQUESTS("too_many_requests")
    QUERY_TOO_LONG("query_too_long")
    REQUEST_TOO_LARGE("request_too_large")
    JsonValue; type "web_search_tool_result_error"constant"web_search_tool_result_error"constant
    List<WebSearchResultBlock>
    String encryptedContent
    Optional<String> pageAge
    String title
    JsonValue; type "web_search_result"constant"web_search_result"constant
    String url
    String toolUseId
    JsonValue; type "web_search_tool_result"constant"web_search_tool_result"constant
    class WebFetchToolResultBlock:
    Caller caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class ServerToolCaller:

    Tool invocation generated by a server-side tool.

    String toolId
    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    class ServerToolCaller20260120:
    String toolId
    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    Content content
    Accepts one of the following:
    class WebFetchToolResultErrorBlock:
    WebFetchToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    URL_TOO_LONG("url_too_long")
    URL_NOT_ALLOWED("url_not_allowed")
    URL_NOT_ACCESSIBLE("url_not_accessible")
    UNSUPPORTED_CONTENT_TYPE("unsupported_content_type")
    TOO_MANY_REQUESTS("too_many_requests")
    MAX_USES_EXCEEDED("max_uses_exceeded")
    UNAVAILABLE("unavailable")
    JsonValue; type "web_fetch_tool_result_error"constant"web_fetch_tool_result_error"constant
    class WebFetchBlock:
    DocumentBlock content
    Optional<CitationsConfig> citations

    Citation configuration for the document

    boolean enabled
    Source source
    Accepts one of the following:
    class Base64PdfSource:
    String data
    JsonValue; mediaType "application/pdf"constant"application/pdf"constant
    JsonValue; type "base64"constant"base64"constant
    class PlainTextSource:
    String data
    JsonValue; mediaType "text/plain"constant"text/plain"constant
    JsonValue; type "text"constant"text"constant
    Optional<String> title

    The title of the document

    JsonValue; type "document"constant"document"constant
    Optional<String> retrievedAt

    ISO 8601 timestamp when the content was retrieved

    JsonValue; type "web_fetch_result"constant"web_fetch_result"constant
    String url

    Fetched content URL

    String toolUseId
    JsonValue; type "web_fetch_tool_result"constant"web_fetch_tool_result"constant
    class CodeExecutionToolResultBlock:
    CodeExecutionToolResultBlockContent content

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

    Accepts one of the following:
    class CodeExecutionToolResultError:
    CodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "code_execution_tool_result_error"constant"code_execution_tool_result_error"constant
    class CodeExecutionResultBlock:
    List<CodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "code_execution_result"constant"code_execution_result"constant
    class EncryptedCodeExecutionResultBlock:

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

    List<CodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    String encryptedStdout
    long returnCode
    String stderr
    JsonValue; type "encrypted_code_execution_result"constant"encrypted_code_execution_result"constant
    String toolUseId
    JsonValue; type "code_execution_tool_result"constant"code_execution_tool_result"constant
    class BashCodeExecutionToolResultBlock:
    Content content
    Accepts one of the following:
    class BashCodeExecutionToolResultError:
    BashCodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    OUTPUT_FILE_TOO_LARGE("output_file_too_large")
    JsonValue; type "bash_code_execution_tool_result_error"constant"bash_code_execution_tool_result_error"constant
    class BashCodeExecutionResultBlock:
    List<BashCodeExecutionOutputBlock> content
    String fileId
    JsonValue; type "bash_code_execution_output"constant"bash_code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "bash_code_execution_result"constant"bash_code_execution_result"constant
    String toolUseId
    JsonValue; type "bash_code_execution_tool_result"constant"bash_code_execution_tool_result"constant
    class TextEditorCodeExecutionToolResultBlock:
    Content content
    Accepts one of the following:
    class TextEditorCodeExecutionToolResultError:
    TextEditorCodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    FILE_NOT_FOUND("file_not_found")
    Optional<String> errorMessage
    JsonValue; type "text_editor_code_execution_tool_result_error"constant"text_editor_code_execution_tool_result_error"constant
    class TextEditorCodeExecutionViewResultBlock:
    String content
    FileType fileType
    Accepts one of the following:
    TEXT("text")
    IMAGE("image")
    PDF("pdf")
    Optional<Long> numLines
    Optional<Long> startLine
    Optional<Long> totalLines
    JsonValue; type "text_editor_code_execution_view_result"constant"text_editor_code_execution_view_result"constant
    class TextEditorCodeExecutionCreateResultBlock:
    boolean isFileUpdate
    JsonValue; type "text_editor_code_execution_create_result"constant"text_editor_code_execution_create_result"constant
    class TextEditorCodeExecutionStrReplaceResultBlock:
    Optional<List<String>> lines
    Optional<Long> newLines
    Optional<Long> newStart
    Optional<Long> oldLines
    Optional<Long> oldStart
    JsonValue; type "text_editor_code_execution_str_replace_result"constant"text_editor_code_execution_str_replace_result"constant
    String toolUseId
    JsonValue; type "text_editor_code_execution_tool_result"constant"text_editor_code_execution_tool_result"constant
    class ToolSearchToolResultBlock:
    Content content
    Accepts one of the following:
    class ToolSearchToolResultError:
    ToolSearchToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    Optional<String> errorMessage
    JsonValue; type "tool_search_tool_result_error"constant"tool_search_tool_result_error"constant
    class ToolSearchToolSearchResultBlock:
    List<ToolReferenceBlock> toolReferences
    String toolName
    JsonValue; type "tool_reference"constant"tool_reference"constant
    JsonValue; type "tool_search_tool_search_result"constant"tool_search_tool_search_result"constant
    String toolUseId
    JsonValue; type "tool_search_tool_result"constant"tool_search_tool_result"constant
    class ContainerUploadBlock:

    Response model for a file uploaded to the container.

    String fileId
    JsonValue; type "container_upload"constant"container_upload"constant
    class ContentBlockParam: A class that can be one of several variants.union

    Regular text content.

    class TextBlockParam:
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class ImageBlockParam:
    Source source
    Accepts one of the following:
    class Base64ImageSource:
    String data
    MediaType mediaType
    Accepts one of the following:
    IMAGE_JPEG("image/jpeg")
    IMAGE_PNG("image/png")
    IMAGE_GIF("image/gif")
    IMAGE_WEBP("image/webp")
    JsonValue; type "base64"constant"base64"constant
    class UrlImageSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "image"constant"image"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class DocumentBlockParam:
    Source source
    Accepts one of the following:
    class Base64PdfSource:
    String data
    JsonValue; mediaType "application/pdf"constant"application/pdf"constant
    JsonValue; type "base64"constant"base64"constant
    class PlainTextSource:
    String data
    JsonValue; mediaType "text/plain"constant"text/plain"constant
    JsonValue; type "text"constant"text"constant
    class ContentBlockSource:
    Content content
    Accepts one of the following:
    String
    List<ContentBlockSourceContent>
    Accepts one of the following:
    class TextBlockParam:
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class ImageBlockParam:
    Source source
    Accepts one of the following:
    class Base64ImageSource:
    String data
    MediaType mediaType
    Accepts one of the following:
    IMAGE_JPEG("image/jpeg")
    IMAGE_PNG("image/png")
    IMAGE_GIF("image/gif")
    IMAGE_WEBP("image/webp")
    JsonValue; type "base64"constant"base64"constant
    class UrlImageSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "image"constant"image"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    JsonValue; type "content"constant"content"constant
    class UrlPdfSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "document"constant"document"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<CitationsConfigParam> citations
    Optional<Boolean> enabled
    Optional<String> context
    Optional<String> title
    class SearchResultBlockParam:
    List<TextBlockParam> content
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    String source
    String title
    JsonValue; type "search_result"constant"search_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<CitationsConfigParam> citations
    Optional<Boolean> enabled
    class ThinkingBlockParam:
    String signature
    String thinking
    JsonValue; type "thinking"constant"thinking"constant
    class RedactedThinkingBlockParam:
    String data
    JsonValue; type "redacted_thinking"constant"redacted_thinking"constant
    class ToolUseBlockParam:
    String id
    Input input
    String name
    JsonValue; type "tool_use"constant"tool_use"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Caller> caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class ServerToolCaller:

    Tool invocation generated by a server-side tool.

    String toolId
    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    class ServerToolCaller20260120:
    String toolId
    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    class ToolResultBlockParam:
    String toolUseId
    JsonValue; type "tool_result"constant"tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Content> content
    Accepts one of the following:
    String
    List<Block>
    Accepts one of the following:
    class TextBlockParam:
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class ImageBlockParam:
    Source source
    Accepts one of the following:
    class Base64ImageSource:
    String data
    MediaType mediaType
    Accepts one of the following:
    IMAGE_JPEG("image/jpeg")
    IMAGE_PNG("image/png")
    IMAGE_GIF("image/gif")
    IMAGE_WEBP("image/webp")
    JsonValue; type "base64"constant"base64"constant
    class UrlImageSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "image"constant"image"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class SearchResultBlockParam:
    List<TextBlockParam> content
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    String source
    String title
    JsonValue; type "search_result"constant"search_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<CitationsConfigParam> citations
    Optional<Boolean> enabled
    class DocumentBlockParam:
    Source source
    Accepts one of the following:
    class Base64PdfSource:
    String data
    JsonValue; mediaType "application/pdf"constant"application/pdf"constant
    JsonValue; type "base64"constant"base64"constant
    class PlainTextSource:
    String data
    JsonValue; mediaType "text/plain"constant"text/plain"constant
    JsonValue; type "text"constant"text"constant
    class ContentBlockSource:
    Content content
    Accepts one of the following:
    String
    List<ContentBlockSourceContent>
    Accepts one of the following:
    class TextBlockParam:
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class ImageBlockParam:
    Source source
    Accepts one of the following:
    class Base64ImageSource:
    String data
    MediaType mediaType
    Accepts one of the following:
    IMAGE_JPEG("image/jpeg")
    IMAGE_PNG("image/png")
    IMAGE_GIF("image/gif")
    IMAGE_WEBP("image/webp")
    JsonValue; type "base64"constant"base64"constant
    class UrlImageSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "image"constant"image"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    JsonValue; type "content"constant"content"constant
    class UrlPdfSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "document"constant"document"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<CitationsConfigParam> citations
    Optional<Boolean> enabled
    Optional<String> context
    Optional<String> title
    class ToolReferenceBlockParam:

    Tool reference block that can be included in tool_result content.

    String toolName
    JsonValue; type "tool_reference"constant"tool_reference"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Boolean> isError
    class ServerToolUseBlockParam:
    String id
    Input input
    Name name
    Accepts one of the following:
    WEB_SEARCH("web_search")
    WEB_FETCH("web_fetch")
    CODE_EXECUTION("code_execution")
    BASH_CODE_EXECUTION("bash_code_execution")
    TEXT_EDITOR_CODE_EXECUTION("text_editor_code_execution")
    TOOL_SEARCH_TOOL_REGEX("tool_search_tool_regex")
    TOOL_SEARCH_TOOL_BM25("tool_search_tool_bm25")
    JsonValue; type "server_tool_use"constant"server_tool_use"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Caller> caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class ServerToolCaller:

    Tool invocation generated by a server-side tool.

    String toolId
    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    class ServerToolCaller20260120:
    String toolId
    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    class WebSearchToolResultBlockParam:
    WebSearchToolResultBlockParamContent content
    Accepts one of the following:
    List<WebSearchResultBlockParam>
    String encryptedContent
    String title
    JsonValue; type "web_search_result"constant"web_search_result"constant
    String url
    Optional<String> pageAge
    class WebSearchToolRequestError:
    WebSearchToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    MAX_USES_EXCEEDED("max_uses_exceeded")
    TOO_MANY_REQUESTS("too_many_requests")
    QUERY_TOO_LONG("query_too_long")
    REQUEST_TOO_LARGE("request_too_large")
    JsonValue; type "web_search_tool_result_error"constant"web_search_tool_result_error"constant
    String toolUseId
    JsonValue; type "web_search_tool_result"constant"web_search_tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Caller> caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class ServerToolCaller:

    Tool invocation generated by a server-side tool.

    String toolId
    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    class ServerToolCaller20260120:
    String toolId
    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    class WebFetchToolResultBlockParam:
    Content content
    Accepts one of the following:
    class WebFetchToolResultErrorBlockParam:
    WebFetchToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    URL_TOO_LONG("url_too_long")
    URL_NOT_ALLOWED("url_not_allowed")
    URL_NOT_ACCESSIBLE("url_not_accessible")
    UNSUPPORTED_CONTENT_TYPE("unsupported_content_type")
    TOO_MANY_REQUESTS("too_many_requests")
    MAX_USES_EXCEEDED("max_uses_exceeded")
    UNAVAILABLE("unavailable")
    JsonValue; type "web_fetch_tool_result_error"constant"web_fetch_tool_result_error"constant
    class WebFetchBlockParam:
    DocumentBlockParam content
    Source source
    Accepts one of the following:
    class Base64PdfSource:
    String data
    JsonValue; mediaType "application/pdf"constant"application/pdf"constant
    JsonValue; type "base64"constant"base64"constant
    class PlainTextSource:
    String data
    JsonValue; mediaType "text/plain"constant"text/plain"constant
    JsonValue; type "text"constant"text"constant
    class ContentBlockSource:
    Content content
    Accepts one of the following:
    String
    List<ContentBlockSourceContent>
    Accepts one of the following:
    class TextBlockParam:
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class ImageBlockParam:
    Source source
    Accepts one of the following:
    class Base64ImageSource:
    String data
    MediaType mediaType
    Accepts one of the following:
    IMAGE_JPEG("image/jpeg")
    IMAGE_PNG("image/png")
    IMAGE_GIF("image/gif")
    IMAGE_WEBP("image/webp")
    JsonValue; type "base64"constant"base64"constant
    class UrlImageSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "image"constant"image"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    JsonValue; type "content"constant"content"constant
    class UrlPdfSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "document"constant"document"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<CitationsConfigParam> citations
    Optional<Boolean> enabled
    Optional<String> context
    Optional<String> title
    JsonValue; type "web_fetch_result"constant"web_fetch_result"constant
    String url

    Fetched content URL

    Optional<String> retrievedAt

    ISO 8601 timestamp when the content was retrieved

    String toolUseId
    JsonValue; type "web_fetch_tool_result"constant"web_fetch_tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<Caller> caller

    Tool invocation directly from the model.

    Accepts one of the following:
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class ServerToolCaller:

    Tool invocation generated by a server-side tool.

    String toolId
    JsonValue; type "code_execution_20250825"constant"code_execution_20250825"constant
    class ServerToolCaller20260120:
    String toolId
    JsonValue; type "code_execution_20260120"constant"code_execution_20260120"constant
    class CodeExecutionToolResultBlockParam:
    CodeExecutionToolResultBlockParamContent content

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

    Accepts one of the following:
    class CodeExecutionToolResultErrorParam:
    CodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "code_execution_tool_result_error"constant"code_execution_tool_result_error"constant
    class CodeExecutionResultBlockParam:
    List<CodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "code_execution_result"constant"code_execution_result"constant
    class EncryptedCodeExecutionResultBlockParam:

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

    List<CodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "code_execution_output"constant"code_execution_output"constant
    String encryptedStdout
    long returnCode
    String stderr
    JsonValue; type "encrypted_code_execution_result"constant"encrypted_code_execution_result"constant
    String toolUseId
    JsonValue; type "code_execution_tool_result"constant"code_execution_tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class BashCodeExecutionToolResultBlockParam:
    Content content
    Accepts one of the following:
    class BashCodeExecutionToolResultErrorParam:
    BashCodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    OUTPUT_FILE_TOO_LARGE("output_file_too_large")
    JsonValue; type "bash_code_execution_tool_result_error"constant"bash_code_execution_tool_result_error"constant
    class BashCodeExecutionResultBlockParam:
    List<BashCodeExecutionOutputBlockParam> content
    String fileId
    JsonValue; type "bash_code_execution_output"constant"bash_code_execution_output"constant
    long returnCode
    String stderr
    String stdout
    JsonValue; type "bash_code_execution_result"constant"bash_code_execution_result"constant
    String toolUseId
    JsonValue; type "bash_code_execution_tool_result"constant"bash_code_execution_tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class TextEditorCodeExecutionToolResultBlockParam:
    Content content
    Accepts one of the following:
    class TextEditorCodeExecutionToolResultErrorParam:
    TextEditorCodeExecutionToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    FILE_NOT_FOUND("file_not_found")
    JsonValue; type "text_editor_code_execution_tool_result_error"constant"text_editor_code_execution_tool_result_error"constant
    Optional<String> errorMessage
    class TextEditorCodeExecutionViewResultBlockParam:
    String content
    FileType fileType
    Accepts one of the following:
    TEXT("text")
    IMAGE("image")
    PDF("pdf")
    JsonValue; type "text_editor_code_execution_view_result"constant"text_editor_code_execution_view_result"constant
    Optional<Long> numLines
    Optional<Long> startLine
    Optional<Long> totalLines
    class TextEditorCodeExecutionCreateResultBlockParam:
    boolean isFileUpdate
    JsonValue; type "text_editor_code_execution_create_result"constant"text_editor_code_execution_create_result"constant
    class TextEditorCodeExecutionStrReplaceResultBlockParam:
    JsonValue; type "text_editor_code_execution_str_replace_result"constant"text_editor_code_execution_str_replace_result"constant
    Optional<List<String>> lines
    Optional<Long> newLines
    Optional<Long> newStart
    Optional<Long> oldLines
    Optional<Long> oldStart
    String toolUseId
    JsonValue; type "text_editor_code_execution_tool_result"constant"text_editor_code_execution_tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class ToolSearchToolResultBlockParam:
    Content content
    Accepts one of the following:
    class ToolSearchToolResultErrorParam:
    ToolSearchToolResultErrorCode errorCode
    Accepts one of the following:
    INVALID_TOOL_INPUT("invalid_tool_input")
    UNAVAILABLE("unavailable")
    TOO_MANY_REQUESTS("too_many_requests")
    EXECUTION_TIME_EXCEEDED("execution_time_exceeded")
    JsonValue; type "tool_search_tool_result_error"constant"tool_search_tool_result_error"constant
    class ToolSearchToolSearchResultBlockParam:
    List<ToolReferenceBlockParam> toolReferences
    String toolName
    JsonValue; type "tool_reference"constant"tool_reference"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    JsonValue; type "tool_search_tool_search_result"constant"tool_search_tool_search_result"constant
    String toolUseId
    JsonValue; type "tool_search_tool_result"constant"tool_search_tool_result"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class ContainerUploadBlockParam:

    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.

    String fileId
    JsonValue; type "container_upload"constant"container_upload"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class ContentBlockSource:
    Content content
    Accepts one of the following:
    String
    List<ContentBlockSourceContent>
    Accepts one of the following:
    class TextBlockParam:
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class ImageBlockParam:
    Source source
    Accepts one of the following:
    class Base64ImageSource:
    String data
    MediaType mediaType
    Accepts one of the following:
    IMAGE_JPEG("image/jpeg")
    IMAGE_PNG("image/png")
    IMAGE_GIF("image/gif")
    IMAGE_WEBP("image/webp")
    JsonValue; type "base64"constant"base64"constant
    class UrlImageSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "image"constant"image"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    JsonValue; type "content"constant"content"constant
    class ContentBlockSourceContent: A class that can be one of several variants.union
    class TextBlockParam:
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endCharIndex
    long startCharIndex
    JsonValue; type "char_location"constant"char_location"constant
    class CitationPageLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endPageNumber
    long startPageNumber
    JsonValue; type "page_location"constant"page_location"constant
    class CitationContentBlockLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle
    long endBlockIndex
    long startBlockIndex
    JsonValue; type "content_block_location"constant"content_block_location"constant
    class CitationWebSearchResultLocationParam:
    String citedText
    String encryptedIndex
    Optional<String> title
    JsonValue; type "web_search_result_location"constant"web_search_result_location"constant
    String url
    class CitationSearchResultLocationParam:
    String citedText
    long endBlockIndex
    long searchResultIndex
    String source
    long startBlockIndex
    Optional<String> title
    JsonValue; type "search_result_location"constant"search_result_location"constant
    class ImageBlockParam:
    Source source
    Accepts one of the following:
    class Base64ImageSource:
    String data
    MediaType mediaType
    Accepts one of the following:
    IMAGE_JPEG("image/jpeg")
    IMAGE_PNG("image/png")
    IMAGE_GIF("image/gif")
    IMAGE_WEBP("image/webp")
    JsonValue; type "base64"constant"base64"constant
    class UrlImageSource:
    JsonValue; type "url"constant"url"constant
    String url
    JsonValue; type "image"constant"image"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    class DirectCaller:

    Tool invocation directly from the model.

    JsonValue; type "direct"constant"direct"constant
    class DocumentBlock:
    Optional<CitationsConfig> citations

    Citation configuration for the document

    boolean enabled
    Source source
    Accepts one of the following:
    class Base64PdfSource:
    String data
    JsonValue; mediaType "application/pdf"constant"application/pdf"constant
    JsonValue; type "base64"constant"base64"constant
    class PlainTextSource:
    String data
    JsonValue; mediaType "text/plain"constant"text/plain"constant
    JsonValue; type "text"constant"text"constant
    Optional<String> title

    The title of the document

    JsonValue; type "document"constant"document"constant
    class DocumentBlockParam:
    Source source
    Accepts one of the following:
    class Base64PdfSource:
    String data
    JsonValue; mediaType "application/pdf"constant"application/pdf"constant
    JsonValue; type "base64"constant"base64"constant
    class PlainTextSource:
    String data
    JsonValue; mediaType "text/plain"constant"text/plain"constant
    JsonValue; type "text"constant"text"constant
    class ContentBlockSource:
    Content content
    Accepts one of the following:
    String
    List<ContentBlockSourceContent>
    Accepts one of the following:
    class TextBlockParam:
    String text
    JsonValue; type "text"constant"text"constant
    Optional<CacheControlEphemeral> cacheControl

    Create a cache control breakpoint at this content block.

    JsonValue; type "ephemeral"constant"ephemeral"constant
    Optional<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:
    TTL_5M("5m")
    TTL_1H("1h")
    Optional<List<TextCitationParam>> citations
    Accepts one of the following:
    class CitationCharLocationParam:
    String citedText
    long documentIndex
    Optional<String> documentTitle