Messages
Create a Message
Count tokens in a Message
ModelsExpand Collapse
Base64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
Base64PDFSource { data, media_type, type }
BashCodeExecutionOutputBlock { file_id, type }
BashCodeExecutionOutputBlockParam { file_id, type }
BashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BashCodeExecutionOutputBlock { file_id, type } >
BashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<BashCodeExecutionOutputBlockParam { file_id, type } >
BashCodeExecutionToolResultBlock { content, tool_use_id, type }
content: BashCodeExecutionToolResultError { error_code, type } | BashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
BashCodeExecutionToolResultError { error_code, type }
error_code: BashCodeExecutionToolResultErrorCode
BashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BashCodeExecutionOutputBlock { file_id, type } >
BashCodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
content: BashCodeExecutionToolResultErrorParam { error_code, type } | BashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
BashCodeExecutionToolResultErrorParam { error_code, type }
error_code: BashCodeExecutionToolResultErrorCode
BashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<BashCodeExecutionOutputBlockParam { file_id, type } >
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BashCodeExecutionToolResultError { error_code, type }
error_code: BashCodeExecutionToolResultErrorCode
BashCodeExecutionToolResultErrorCode = "invalid_tool_input" | "unavailable" | "too_many_requests" | 2 more
BashCodeExecutionToolResultErrorParam { error_code, type }
error_code: BashCodeExecutionToolResultErrorCode
CacheControlEphemeral { type, ttl }
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }
The number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 5 minute cache entry.
CitationCharLocation { cited_text, document_index, document_title, 4 more }
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocation { cited_text, document_index, document_title, 4 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationsConfig { enabled }
CitationsConfigParam { enabled }
CitationsDelta { citation, type }
citation: CitationCharLocation { cited_text, document_index, document_title, 4 more } | CitationPageLocation { cited_text, document_index, document_title, 4 more } | CitationContentBlockLocation { cited_text, document_index, document_title, 4 more } | 2 more
CitationCharLocation { cited_text, document_index, document_title, 4 more }
CitationPageLocation { cited_text, document_index, document_title, 4 more }
CitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
CitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
CitationsSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
CitationsSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
CitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
CodeExecutionOutputBlock { file_id, type }
CodeExecutionOutputBlockParam { file_id, type }
CodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<CodeExecutionOutputBlock { file_id, type } >
CodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<CodeExecutionOutputBlockParam { file_id, type } >
CodeExecutionTool20250522 { name, type, allowed_callers, 3 more }
name: "code_execution"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
allowed_callers?: Array<"direct" | "code_execution_20250825" | "code_execution_20260120">
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
CodeExecutionTool20250825 { name, type, allowed_callers, 3 more }
name: "code_execution"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
allowed_callers?: Array<"direct" | "code_execution_20250825" | "code_execution_20260120">
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
CodeExecutionTool20260120 { name, type, allowed_callers, 3 more } Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
name: "code_execution"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
allowed_callers?: Array<"direct" | "code_execution_20250825" | "code_execution_20260120">
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
CodeExecutionToolResultBlock { content, tool_use_id, type }
content: CodeExecutionToolResultBlockContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
CodeExecutionToolResultError { error_code, type }
error_code: CodeExecutionToolResultErrorCode
CodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<CodeExecutionOutputBlock { file_id, type } >
EncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<CodeExecutionOutputBlock { file_id, type } >
CodeExecutionToolResultBlockContent = CodeExecutionToolResultError { error_code, type } | CodeExecutionResultBlock { content, return_code, stderr, 2 more } | EncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
CodeExecutionToolResultError { error_code, type }
error_code: CodeExecutionToolResultErrorCode
CodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<CodeExecutionOutputBlock { file_id, type } >
EncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<CodeExecutionOutputBlock { file_id, type } >
CodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
CodeExecutionToolResultErrorParam { error_code, type }
error_code: CodeExecutionToolResultErrorCode
CodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<CodeExecutionOutputBlockParam { file_id, type } >
EncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<CodeExecutionOutputBlockParam { file_id, type } >
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
CodeExecutionToolResultBlockParamContent = CodeExecutionToolResultErrorParam { error_code, type } | CodeExecutionResultBlockParam { content, return_code, stderr, 2 more } | EncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
CodeExecutionToolResultErrorParam { error_code, type }
error_code: CodeExecutionToolResultErrorCode
CodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<CodeExecutionOutputBlockParam { file_id, type } >
EncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<CodeExecutionOutputBlockParam { file_id, type } >
CodeExecutionToolResultError { error_code, type }
error_code: CodeExecutionToolResultErrorCode
CodeExecutionToolResultErrorCode = "invalid_tool_input" | "unavailable" | "too_many_requests" | "execution_time_exceeded"
CodeExecutionToolResultErrorParam { error_code, type }
error_code: CodeExecutionToolResultErrorCode
Container { id, expires_at } Information about the container used in the request (for the code execution tool)
Information about the container used in the request (for the code execution tool)
Identifier for the container used in this request
The time at which the container will expire.
ContainerUploadBlock { file_id, type } Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
ContainerUploadBlockParam { file_id, type, cache_control } A content block that represents a file to be uploaded to the container
Files uploaded via this block will be available in the container's input directory.
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.
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
ContentBlock = TextBlock { citations, text, type } | ThinkingBlock { signature, thinking, type } | RedactedThinkingBlock { data, type } | 9 moreResponse model for a file uploaded to the container.
Response model for a file uploaded to the container.
TextBlock { citations, text, type }
citations: Array<TextCitation> | nullCitations supporting the text block.
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.
CitationCharLocation { cited_text, document_index, document_title, 4 more }
CitationPageLocation { cited_text, document_index, document_title, 4 more }
CitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
CitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
CitationsSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
ThinkingBlock { signature, thinking, type }
RedactedThinkingBlock { data, type }
ToolUseBlock { id, caller, input, 2 more }
caller: DirectCaller { type } | ServerToolCaller { tool_id, type } | ServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
ServerToolUseBlock { id, caller, input, 2 more }
caller: DirectCaller { type } | ServerToolCaller { tool_id, type } | ServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
name: "web_search" | "web_fetch" | "code_execution" | 4 more
WebSearchToolResultBlock { caller, content, tool_use_id, type }
caller: DirectCaller { type } | ServerToolCaller { tool_id, type } | ServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
content: WebSearchToolResultBlockContent
WebSearchToolResultError { error_code, type }
error_code: WebSearchToolResultErrorCode
Array<WebSearchResultBlock { encrypted_content, page_age, title, 2 more } >
WebFetchToolResultBlock { caller, content, tool_use_id, type }
caller: DirectCaller { type } | ServerToolCaller { tool_id, type } | ServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
content: WebFetchToolResultErrorBlock { error_code, type } | WebFetchBlock { content, retrieved_at, type, url }
WebFetchToolResultErrorBlock { error_code, type }
error_code: WebFetchToolResultErrorCode
WebFetchBlock { content, retrieved_at, type, url }
content: DocumentBlock { citations, source, title, type }
citations: CitationsConfig { enabled } | nullCitation configuration for the document
Citation configuration for the document
source: Base64PDFSource { data, media_type, type } | PlainTextSource { data, media_type, type }
Base64PDFSource { data, media_type, type }
PlainTextSource { data, media_type, type }
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
CodeExecutionToolResultBlock { content, tool_use_id, type }
content: CodeExecutionToolResultBlockContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
CodeExecutionToolResultError { error_code, type }
error_code: CodeExecutionToolResultErrorCode
CodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<CodeExecutionOutputBlock { file_id, type } >
EncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<CodeExecutionOutputBlock { file_id, type } >
BashCodeExecutionToolResultBlock { content, tool_use_id, type }
content: BashCodeExecutionToolResultError { error_code, type } | BashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
BashCodeExecutionToolResultError { error_code, type }
error_code: BashCodeExecutionToolResultErrorCode
BashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BashCodeExecutionOutputBlock { file_id, type } >
TextEditorCodeExecutionToolResultBlock { content, tool_use_id, type }
content: TextEditorCodeExecutionToolResultError { error_code, error_message, type } | TextEditorCodeExecutionViewResultBlock { content, file_type, num_lines, 3 more } | TextEditorCodeExecutionCreateResultBlock { is_file_update, type } | TextEditorCodeExecutionStrReplaceResultBlock { lines, new_lines, new_start, 3 more }
TextEditorCodeExecutionToolResultError { error_code, error_message, type }
error_code: TextEditorCodeExecutionToolResultErrorCode
TextEditorCodeExecutionViewResultBlock { content, file_type, num_lines, 3 more }
file_type: "text" | "image" | "pdf"
TextEditorCodeExecutionCreateResultBlock { is_file_update, type }
TextEditorCodeExecutionStrReplaceResultBlock { lines, new_lines, new_start, 3 more }
ToolSearchToolResultBlock { content, tool_use_id, type }
content: ToolSearchToolResultError { error_code, error_message, type } | ToolSearchToolSearchResultBlock { tool_references, type }
ToolSearchToolResultError { error_code, error_message, type }
error_code: ToolSearchToolResultErrorCode
ToolSearchToolSearchResultBlock { tool_references, type }
tool_references: Array<ToolReferenceBlock { tool_name, type } >
ContainerUploadBlock { file_id, type } Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
ContentBlockParam = TextBlockParam { text, type, cache_control, citations } | ImageBlockParam { source, type, cache_control } | DocumentBlockParam { source, type, cache_control, 3 more } | 13 moreRegular text content.
Regular text content.
TextBlockParam { text, type, cache_control, citations }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
ImageBlockParam { source, type, cache_control }
source: Base64ImageSource { data, media_type, type } | URLImageSource { type, url }
Base64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
URLImageSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
DocumentBlockParam { source, type, cache_control, 3 more }
source: Base64PDFSource { data, media_type, type } | PlainTextSource { data, media_type, type } | ContentBlockSource { content, type } | URLPDFSource { type, url }
Base64PDFSource { data, media_type, type }
PlainTextSource { data, media_type, type }
ContentBlockSource { content, type }
content: string | Array<ContentBlockSourceContent>
Array<ContentBlockSourceContent>
TextBlockParam { text, type, cache_control, citations }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
ImageBlockParam { source, type, cache_control }
source: Base64ImageSource { data, media_type, type } | URLImageSource { type, url }
Base64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
URLImageSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
URLPDFSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: CitationsConfigParam { enabled } | null
SearchResultBlockParam { content, source, title, 3 more }
content: Array<TextBlockParam { text, type, cache_control, citations } >
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: CitationsConfigParam { enabled }
ThinkingBlockParam { signature, thinking, type }
RedactedThinkingBlockParam { data, type }
ToolUseBlockParam { id, input, name, 3 more }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
caller?: DirectCaller { type } | ServerToolCaller { tool_id, type } | ServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
ToolResultBlockParam { tool_use_id, type, cache_control, 2 more }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
content?: string | Array<TextBlockParam { text, type, cache_control, citations } | ImageBlockParam { source, type, cache_control } | SearchResultBlockParam { content, source, title, 3 more } | 2 more>
Array<TextBlockParam { text, type, cache_control, citations } | ImageBlockParam { source, type, cache_control } | SearchResultBlockParam { content, source, title, 3 more } | 2 more>
TextBlockParam { text, type, cache_control, citations }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
ImageBlockParam { source, type, cache_control }
source: Base64ImageSource { data, media_type, type } | URLImageSource { type, url }
Base64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
URLImageSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
SearchResultBlockParam { content, source, title, 3 more }
content: Array<TextBlockParam { text, type, cache_control, citations } >
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: CitationsConfigParam { enabled }
DocumentBlockParam { source, type, cache_control, 3 more }
source: Base64PDFSource { data, media_type, type } | PlainTextSource { data, media_type, type } | ContentBlockSource { content, type } | URLPDFSource { type, url }
Base64PDFSource { data, media_type, type }
PlainTextSource { data, media_type, type }
ContentBlockSource { content, type }
content: string | Array<ContentBlockSourceContent>
Array<ContentBlockSourceContent>
TextBlockParam { text, type, cache_control, citations }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
ImageBlockParam { source, type, cache_control }
source: Base64ImageSource { data, media_type, type } | URLImageSource { type, url }
Base64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
URLImageSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
URLPDFSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: CitationsConfigParam { enabled } | null
ToolReferenceBlockParam { tool_name, type, cache_control } Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
ServerToolUseBlockParam { id, input, name, 3 more }
name: "web_search" | "web_fetch" | "code_execution" | 4 more
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
caller?: DirectCaller { type } | ServerToolCaller { tool_id, type } | ServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
WebSearchToolResultBlockParam { content, tool_use_id, type, 2 more }
content: WebSearchToolResultBlockParamContent
Array<WebSearchResultBlockParam { encrypted_content, title, type, 2 more } >
WebSearchToolRequestError { error_code, type }
error_code: WebSearchToolResultErrorCode
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
caller?: DirectCaller { type } | ServerToolCaller { tool_id, type } | ServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
WebFetchToolResultBlockParam { content, tool_use_id, type, 2 more }
content: WebFetchToolResultErrorBlockParam { error_code, type } | WebFetchBlockParam { content, type, url, retrieved_at }
WebFetchToolResultErrorBlockParam { error_code, type }
error_code: WebFetchToolResultErrorCode
WebFetchBlockParam { content, type, url, retrieved_at }
content: DocumentBlockParam { source, type, cache_control, 3 more }
source: Base64PDFSource { data, media_type, type } | PlainTextSource { data, media_type, type } | ContentBlockSource { content, type } | URLPDFSource { type, url }
Base64PDFSource { data, media_type, type }
PlainTextSource { data, media_type, type }
ContentBlockSource { content, type }
content: string | Array<ContentBlockSourceContent>
Array<ContentBlockSourceContent>
TextBlockParam { text, type, cache_control, citations }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
ImageBlockParam { source, type, cache_control }
source: Base64ImageSource { data, media_type, type } | URLImageSource { type, url }
Base64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
URLImageSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
URLPDFSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: CitationsConfigParam { enabled } | null
Fetched content URL
ISO 8601 timestamp when the content was retrieved
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
caller?: DirectCaller { type } | ServerToolCaller { tool_id, type } | ServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
CodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
CodeExecutionToolResultErrorParam { error_code, type }
error_code: CodeExecutionToolResultErrorCode
CodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<CodeExecutionOutputBlockParam { file_id, type } >
EncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<CodeExecutionOutputBlockParam { file_id, type } >
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BashCodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
content: BashCodeExecutionToolResultErrorParam { error_code, type } | BashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
BashCodeExecutionToolResultErrorParam { error_code, type }
error_code: BashCodeExecutionToolResultErrorCode
BashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<BashCodeExecutionOutputBlockParam { file_id, type } >
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
TextEditorCodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
content: TextEditorCodeExecutionToolResultErrorParam { error_code, type, error_message } | TextEditorCodeExecutionViewResultBlockParam { content, file_type, type, 3 more } | TextEditorCodeExecutionCreateResultBlockParam { is_file_update, type } | TextEditorCodeExecutionStrReplaceResultBlockParam { type, lines, new_lines, 3 more }
TextEditorCodeExecutionToolResultErrorParam { error_code, type, error_message }
error_code: TextEditorCodeExecutionToolResultErrorCode
TextEditorCodeExecutionViewResultBlockParam { content, file_type, type, 3 more }
file_type: "text" | "image" | "pdf"
TextEditorCodeExecutionCreateResultBlockParam { is_file_update, type }
TextEditorCodeExecutionStrReplaceResultBlockParam { type, lines, new_lines, 3 more }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
ToolSearchToolResultBlockParam { content, tool_use_id, type, cache_control }
content: ToolSearchToolResultErrorParam { error_code, type } | ToolSearchToolSearchResultBlockParam { tool_references, type }
ToolSearchToolResultErrorParam { error_code, type }
error_code: ToolSearchToolResultErrorCode
ToolSearchToolSearchResultBlockParam { tool_references, type }
tool_references: Array<ToolReferenceBlockParam { tool_name, type, cache_control } >
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
ContainerUploadBlockParam { file_id, type, cache_control } A content block that represents a file to be uploaded to the container
Files uploaded via this block will be available in the container's input directory.
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.
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
ContentBlockSource { content, type }
content: string | Array<ContentBlockSourceContent>
Array<ContentBlockSourceContent>
TextBlockParam { text, type, cache_control, citations }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
ImageBlockParam { source, type, cache_control }
source: Base64ImageSource { data, media_type, type } | URLImageSource { type, url }
Base64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
URLImageSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
ContentBlockSourceContent = TextBlockParam { text, type, cache_control, citations } | ImageBlockParam { source, type, cache_control }
TextBlockParam { text, type, cache_control, citations }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<TextCitationParam> | null
CitationCharLocationParam { cited_text, document_index, document_title, 3 more }
CitationPageLocationParam { cited_text, document_index, document_title, 3 more }
CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
CitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
CitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
ImageBlockParam { source, type, cache_control }
source: Base64ImageSource { data, media_type, type } | URLImageSource { type, url }
Base64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
URLImageSource { type, url }
cache_control?: CacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
DirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
DocumentBlock { citations, source, title, type }
citations: CitationsConfig { enabled } | nullCitation configuration for the document
Citation configuration for the document