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
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
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
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 } >
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 } >
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.
InputJSONDelta { partial_json, type }
JSONOutputFormat { schema, type }
The JSON schema of the format
MemoryTool20250818 { name, type, allowed_callers, 4 more }
name: "memory"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
Message { id, container, content, 6 more }
id: stringUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
container: Container { id, expires_at } | nullInformation 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.
content: Array<ContentBlock>Content generated by the model.
Content generated by the model.
This is an array of content blocks, each of which has a type that determines its shape.
Example:
[{"type": "text", "text": "Hi, I'm Claude."}]
If the request input messages ended with an assistant turn, then the response content will continue directly from that last turn. You can use this to constrain the model's output.
For example, if the input messages were:
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("}
]
Then the response content might be:
[{"type": "text", "text": "B)"}]
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.
model: ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
"claude-opus-4-6" | "claude-sonnet-4-6" | "claude-opus-4-5-20251101" | 19 more
Most intelligent model for building agents and coding
Frontier intelligence at scale — built for coding, agents, and enterprise workflows
Premium model combining maximum intelligence with practical performance
Premium model combining maximum intelligence with practical performance
High-performance model with early extended thinking
High-performance model with early extended thinking
Fastest and most compact model for near-instant responsiveness
Our fastest model
Hybrid model, capable of near-instant responses and extended thinking
Hybrid model, capable of near-instant responses and extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
Our best model for real-world agents and coding
Our best model for real-world agents and coding
Our most capable model
Our most capable model
Our most capable model
Our most capable model
Excels at writing and complex tasks
Excels at writing and complex tasks
Our previous most fast and cost-effective
role: "assistant"Conversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
stop_reason: StopReason | nullThe reason that we stopped.
The reason that we stopped.
This may be one the following values:
"end_turn": the model reached a natural stopping point"max_tokens": we exceeded the requestedmax_tokensor the model's maximum"stop_sequence": one of your provided customstop_sequenceswas generated"tool_use": the model invoked one or more tools"pause_turn": we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue."refusal": when streaming classifiers intervene to handle potential policy violations
In non-streaming mode this value is always non-null. In streaming mode, it is null in the message_start event and non-null otherwise.
stop_sequence: string | nullWhich custom stop sequence was generated, if any.
Which custom stop sequence was generated, if any.
This value will be a non-null string if one of your custom stop sequences was generated.
type: "message"Object type.
Object type.
For Messages, this is always "message".
usage: Usage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more } Billing and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
cache_creation: CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } | nullBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
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.
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The geographic region where inference was performed for this request.
The number of input tokens which were used.
The number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
service_tier: "standard" | "priority" | "batch" | nullIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
MessageCountTokensTool = Tool { input_schema, name, allowed_callers, 7 more } | ToolBash20250124 { name, type, allowed_callers, 4 more } | CodeExecutionTool20250522 { name, type, allowed_callers, 3 more } | 12 moreCode execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Tool { input_schema, name, allowed_callers, 7 more }
input_schema: InputSchema { type, properties, required } JSON schema for this tool's input.
JSON schema for this tool's input.
This defines the shape of the input that your tool accepts and that the model will produce.
name: stringName 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.
description?: stringDescription of what this tool does.
Description of what this tool does.
Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
When true, guarantees schema validation on tool names and inputs
ToolBash20250124 { name, type, allowed_callers, 4 more }
name: "bash"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
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
MemoryTool20250818 { name, type, allowed_callers, 4 more }
name: "memory"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
ToolTextEditor20250124 { name, type, allowed_callers, 4 more }
name: "str_replace_editor"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
ToolTextEditor20250429 { name, type, allowed_callers, 4 more }
name: "str_replace_based_edit_tool"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
ToolTextEditor20250728 { name, type, allowed_callers, 5 more }
name: "str_replace_based_edit_tool"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.
Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
When true, guarantees schema validation on tool names and inputs
WebSearchTool20250305 { name, type, allowed_callers, 7 more }
name: "web_search"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">
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
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.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
user_location?: UserLocation { type, city, country, 2 more } | nullParameters for the user's location. Used to provide more relevant search results.
Parameters for the user's location. Used to provide more relevant search results.
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
WebFetchTool20250910 { name, type, allowed_callers, 8 more }
name: "web_fetch"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">
List of domains to allow fetching from
List of domains to block fetching from
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 } | nullCitations configuration for fetched documents. Citations are disabled by default.
Citations configuration for fetched documents. Citations are disabled by default.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
WebSearchTool20260209 { name, type, allowed_callers, 7 more }
name: "web_search"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">
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
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.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
user_location?: UserLocation { type, city, country, 2 more } | nullParameters for the user's location. Used to provide more relevant search results.
Parameters for the user's location. Used to provide more relevant search results.
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
WebFetchTool20260209 { name, type, allowed_callers, 8 more }
name: "web_fetch"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">
List of domains to allow fetching from
List of domains to block fetching from
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 } | nullCitations configuration for fetched documents. Citations are disabled by default.
Citations configuration for fetched documents. Citations are disabled by default.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
ToolSearchToolBm25_20251119 { name, type, allowed_callers, 3 more }
name: "tool_search_tool_bm25"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
type: "tool_search_tool_bm25_20251119" | "tool_search_tool_bm25"
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
ToolSearchToolRegex20251119 { name, type, allowed_callers, 3 more }
name: "tool_search_tool_regex"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
type: "tool_search_tool_regex_20251119" | "tool_search_tool_regex"
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
MessageDeltaUsage { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more }
The cumulative number of input tokens used to create the cache entry.
The cumulative number of input tokens read from the cache.
The cumulative number of input tokens which were used.
The cumulative number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
MessageParam { content, role }
content: string | Array<ContentBlockParam>
Array<ContentBlockParam>
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.
role: "user" | "assistant"
MessageTokensCount { input_tokens }
The total number of tokens across the provided list of messages, system prompt, and tools.
Metadata { user_id }
user_id?: string | nullAn external identifier for the user who is associated with the request.
An external identifier for the user who is associated with the request.
This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
Model = "claude-opus-4-6" | "claude-sonnet-4-6" | "claude-opus-4-5-20251101" | 19 more | (string & {})The model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
"claude-opus-4-6" | "claude-sonnet-4-6" | "claude-opus-4-5-20251101" | 19 more
Most intelligent model for building agents and coding
Frontier intelligence at scale — built for coding, agents, and enterprise workflows
Premium model combining maximum intelligence with practical performance
Premium model combining maximum intelligence with practical performance
High-performance model with early extended thinking
High-performance model with early extended thinking
Fastest and most compact model for near-instant responsiveness
Our fastest model
Hybrid model, capable of near-instant responses and extended thinking
Hybrid model, capable of near-instant responses and extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
Our best model for real-world agents and coding
Our best model for real-world agents and coding
Our most capable model
Our most capable model
Our most capable model
Our most capable model
Excels at writing and complex tasks
Excels at writing and complex tasks
Our previous most fast and cost-effective
OutputConfig { effort, format }
effort?: "low" | "medium" | "high" | "max" | nullAll possible effort levels.
All possible effort levels.
format?: JSONOutputFormat { schema, type } | nullA schema to specify Claude's output format in responses. See structured outputs
A schema to specify Claude's output format in responses. See structured outputs
The JSON schema of the format
PlainTextSource { data, media_type, type }
RawContentBlockDelta = TextDelta { text, type } | InputJSONDelta { partial_json, type } | CitationsDelta { citation, type } | 2 more
TextDelta { text, type }
InputJSONDelta { partial_json, type }
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 }
ThinkingDelta { thinking, type }
SignatureDelta { signature, type }
RawContentBlockDeltaEvent { delta, index, type }
delta: RawContentBlockDelta
TextDelta { text, type }
InputJSONDelta { partial_json, type }
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 }
ThinkingDelta { thinking, type }
SignatureDelta { signature, type }
RawContentBlockStartEvent { content_block, index, type }
content_block: 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.
RawContentBlockStopEvent { index, type }
RawMessageDeltaEvent { delta, type, usage }
delta: Delta { container, stop_reason, stop_sequence }
container: Container { id, expires_at } | nullInformation 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.
stop_reason: StopReason | null
usage: MessageDeltaUsage { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more } Billing and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
The cumulative number of input tokens used to create the cache entry.
The cumulative number of input tokens read from the cache.
The cumulative number of input tokens which were used.
The cumulative number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
RawMessageStartEvent { message, type }
message: Message { id, container, content, 6 more }
id: stringUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
container: Container { id, expires_at } | nullInformation 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.
content: Array<ContentBlock>Content generated by the model.
Content generated by the model.
This is an array of content blocks, each of which has a type that determines its shape.
Example:
[{"type": "text", "text": "Hi, I'm Claude."}]
If the request input messages ended with an assistant turn, then the response content will continue directly from that last turn. You can use this to constrain the model's output.
For example, if the input messages were:
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("}
]
Then the response content might be:
[{"type": "text", "text": "B)"}]
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.
model: ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
"claude-opus-4-6" | "claude-sonnet-4-6" | "claude-opus-4-5-20251101" | 19 more
Most intelligent model for building agents and coding
Frontier intelligence at scale — built for coding, agents, and enterprise workflows
Premium model combining maximum intelligence with practical performance
Premium model combining maximum intelligence with practical performance
High-performance model with early extended thinking
High-performance model with early extended thinking
Fastest and most compact model for near-instant responsiveness
Our fastest model
Hybrid model, capable of near-instant responses and extended thinking
Hybrid model, capable of near-instant responses and extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
Our best model for real-world agents and coding
Our best model for real-world agents and coding
Our most capable model
Our most capable model
Our most capable model
Our most capable model
Excels at writing and complex tasks
Excels at writing and complex tasks
Our previous most fast and cost-effective
role: "assistant"Conversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
stop_reason: StopReason | nullThe reason that we stopped.
The reason that we stopped.
This may be one the following values:
"end_turn": the model reached a natural stopping point"max_tokens": we exceeded the requestedmax_tokensor the model's maximum"stop_sequence": one of your provided customstop_sequenceswas generated"tool_use": the model invoked one or more tools"pause_turn": we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue."refusal": when streaming classifiers intervene to handle potential policy violations
In non-streaming mode this value is always non-null. In streaming mode, it is null in the message_start event and non-null otherwise.
stop_sequence: string | nullWhich custom stop sequence was generated, if any.
Which custom stop sequence was generated, if any.
This value will be a non-null string if one of your custom stop sequences was generated.
type: "message"Object type.
Object type.
For Messages, this is always "message".
usage: Usage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more } Billing and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
cache_creation: CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } | nullBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
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.
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The geographic region where inference was performed for this request.
The number of input tokens which were used.
The number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
service_tier: "standard" | "priority" | "batch" | nullIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
RawMessageStopEvent { type }
RawMessageStreamEvent = RawMessageStartEvent { message, type } | RawMessageDeltaEvent { delta, type, usage } | RawMessageStopEvent { type } | 3 more
RawMessageStartEvent { message, type }
message: Message { id, container, content, 6 more }
id: stringUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
container: Container { id, expires_at } | nullInformation 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.
content: Array<ContentBlock>Content generated by the model.
Content generated by the model.
This is an array of content blocks, each of which has a type that determines its shape.
Example:
[{"type": "text", "text": "Hi, I'm Claude."}]
If the request input messages ended with an assistant turn, then the response content will continue directly from that last turn. You can use this to constrain the model's output.
For example, if the input messages were:
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("}
]
Then the response content might be:
[{"type": "text", "text": "B)"}]
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.
model: ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
"claude-opus-4-6" | "claude-sonnet-4-6" | "claude-opus-4-5-20251101" | 19 more
Most intelligent model for building agents and coding
Frontier intelligence at scale — built for coding, agents, and enterprise workflows
Premium model combining maximum intelligence with practical performance
Premium model combining maximum intelligence with practical performance
High-performance model with early extended thinking
High-performance model with early extended thinking
Fastest and most compact model for near-instant responsiveness
Our fastest model
Hybrid model, capable of near-instant responses and extended thinking
Hybrid model, capable of near-instant responses and extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
Our best model for real-world agents and coding
Our best model for real-world agents and coding
Our most capable model
Our most capable model
Our most capable model
Our most capable model
Excels at writing and complex tasks
Excels at writing and complex tasks
Our previous most fast and cost-effective
role: "assistant"Conversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
stop_reason: StopReason | nullThe reason that we stopped.
The reason that we stopped.
This may be one the following values:
"end_turn": the model reached a natural stopping point"max_tokens": we exceeded the requestedmax_tokensor the model's maximum"stop_sequence": one of your provided customstop_sequenceswas generated"tool_use": the model invoked one or more tools"pause_turn": we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue."refusal": when streaming classifiers intervene to handle potential policy violations
In non-streaming mode this value is always non-null. In streaming mode, it is null in the message_start event and non-null otherwise.
stop_sequence: string | nullWhich custom stop sequence was generated, if any.
Which custom stop sequence was generated, if any.
This value will be a non-null string if one of your custom stop sequences was generated.
type: "message"Object type.
Object type.
For Messages, this is always "message".
usage: Usage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more } Billing and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
cache_creation: CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } | nullBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
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.
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The geographic region where inference was performed for this request.
The number of input tokens which were used.
The number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
service_tier: "standard" | "priority" | "batch" | nullIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
RawMessageDeltaEvent { delta, type, usage }
delta: Delta { container, stop_reason, stop_sequence }
container: Container { id, expires_at } | nullInformation 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.
stop_reason: StopReason | null
usage: MessageDeltaUsage { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 2 more } Billing and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
The cumulative number of input tokens used to create the cache entry.
The cumulative number of input tokens read from the cache.
The cumulative number of input tokens which were used.
The cumulative number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
RawMessageStopEvent { type }
RawContentBlockStartEvent { content_block, index, type }
content_block: 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.
RawContentBlockDeltaEvent { delta, index, type }
delta: RawContentBlockDelta
TextDelta { text, type }
InputJSONDelta { partial_json, type }
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 }
ThinkingDelta { thinking, type }
SignatureDelta { signature, type }
RawContentBlockStopEvent { index, type }
RedactedThinkingBlock { data, type }
RedactedThinkingBlockParam { data, type }
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 }
ServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ServerToolCaller20260120 { tool_id, type }
ServerToolUsage { web_fetch_requests, web_search_requests }
The number of web fetch tool requests.
The number of web search tool requests.
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
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 }
SignatureDelta { signature, type }
StopReason = "end_turn" | "max_tokens" | "stop_sequence" | 3 more
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 }
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 }
TextCitation = 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 }
TextCitationParam = 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 } | 2 more
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 }
TextDelta { text, type }
TextEditorCodeExecutionCreateResultBlock { is_file_update, type }
TextEditorCodeExecutionCreateResultBlockParam { is_file_update, type }
TextEditorCodeExecutionStrReplaceResultBlock { lines, new_lines, new_start, 3 more }
TextEditorCodeExecutionStrReplaceResultBlockParam { type, lines, new_lines, 3 more }
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 }
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.
TextEditorCodeExecutionToolResultError { error_code, error_message, type }
error_code: TextEditorCodeExecutionToolResultErrorCode
TextEditorCodeExecutionToolResultErrorCode = "invalid_tool_input" | "unavailable" | "too_many_requests" | 2 more
TextEditorCodeExecutionToolResultErrorParam { error_code, type, error_message }
error_code: TextEditorCodeExecutionToolResultErrorCode
TextEditorCodeExecutionViewResultBlock { content, file_type, num_lines, 3 more }
file_type: "text" | "image" | "pdf"
TextEditorCodeExecutionViewResultBlockParam { content, file_type, type, 3 more }
file_type: "text" | "image" | "pdf"
ThinkingBlock { signature, thinking, type }
ThinkingBlockParam { signature, thinking, type }
ThinkingConfigAdaptive { type }
ThinkingConfigDisabled { type }
ThinkingConfigEnabled { budget_tokens, type }
budget_tokens: numberDetermines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
Must be ≥1024 and less than max_tokens.
See extended thinking for details.
ThinkingConfigParam = ThinkingConfigEnabled { budget_tokens, type } | ThinkingConfigDisabled { type } | ThinkingConfigAdaptive { type } Configuration for enabling Claude's extended thinking.
Configuration for enabling Claude's extended thinking.
When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your max_tokens limit.
See extended thinking for details.
ThinkingConfigEnabled { budget_tokens, type }
budget_tokens: numberDetermines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
Must be ≥1024 and less than max_tokens.
See extended thinking for details.
ThinkingConfigDisabled { type }
ThinkingConfigAdaptive { type }
ThinkingDelta { thinking, type }
Tool { input_schema, name, allowed_callers, 7 more }
input_schema: InputSchema { type, properties, required } JSON schema for this tool's input.
JSON schema for this tool's input.
This defines the shape of the input that your tool accepts and that the model will produce.
name: stringName 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.
description?: stringDescription of what this tool does.
Description of what this tool does.
Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
When true, guarantees schema validation on tool names and inputs
ToolBash20250124 { name, type, allowed_callers, 4 more }
name: "bash"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
ToolChoice = ToolChoiceAuto { type, disable_parallel_tool_use } | ToolChoiceAny { type, disable_parallel_tool_use } | ToolChoiceTool { name, type, disable_parallel_tool_use } | ToolChoiceNone { type } How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
ToolChoiceAuto { type, disable_parallel_tool_use } The model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
disable_parallel_tool_use?: booleanWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output at most one tool use.
ToolChoiceAny { type, disable_parallel_tool_use } The model will use any available tools.
The model will use any available tools.
disable_parallel_tool_use?: booleanWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
ToolChoiceTool { name, type, disable_parallel_tool_use } The model will use the specified tool with tool_choice.name.
The model will use the specified tool with tool_choice.name.
The name of the tool to use.
disable_parallel_tool_use?: booleanWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
ToolChoiceNone { type } The model will not be allowed to use tools.
The model will not be allowed to use tools.
ToolChoiceAny { type, disable_parallel_tool_use } The model will use any available tools.
The model will use any available tools.
disable_parallel_tool_use?: booleanWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
ToolChoiceAuto { type, disable_parallel_tool_use } The model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
disable_parallel_tool_use?: booleanWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output at most one tool use.
ToolChoiceNone { type } The model will not be allowed to use tools.
The model will not be allowed to use tools.
ToolChoiceTool { name, type, disable_parallel_tool_use } The model will use the specified tool with tool_choice.name.
The model will use the specified tool with tool_choice.name.
The name of the tool to use.
disable_parallel_tool_use?: booleanWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
ToolReferenceBlock { tool_name, type }
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.
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.
ToolSearchToolBm25_20251119 { name, type, allowed_callers, 3 more }
name: "tool_search_tool_bm25"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
type: "tool_search_tool_bm25_20251119" | "tool_search_tool_bm25"
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
ToolSearchToolRegex20251119 { name, type, allowed_callers, 3 more }
name: "tool_search_tool_regex"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
type: "tool_search_tool_regex_20251119" | "tool_search_tool_regex"
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
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 } >
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.
ToolSearchToolResultError { error_code, error_message, type }
error_code: ToolSearchToolResultErrorCode
ToolSearchToolResultErrorCode = "invalid_tool_input" | "unavailable" | "too_many_requests" | "execution_time_exceeded"
ToolSearchToolResultErrorParam { error_code, type }
error_code: ToolSearchToolResultErrorCode
ToolSearchToolSearchResultBlock { tool_references, type }
tool_references: Array<ToolReferenceBlock { tool_name, type } >
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.
ToolTextEditor20250124 { name, type, allowed_callers, 4 more }
name: "str_replace_editor"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
ToolTextEditor20250429 { name, type, allowed_callers, 4 more }
name: "str_replace_based_edit_tool"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
ToolTextEditor20250728 { name, type, allowed_callers, 5 more }
name: "str_replace_based_edit_tool"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.
Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
When true, guarantees schema validation on tool names and inputs
ToolUnion = Tool { input_schema, name, allowed_callers, 7 more } | ToolBash20250124 { name, type, allowed_callers, 4 more } | CodeExecutionTool20250522 { name, type, allowed_callers, 3 more } | 12 moreCode execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Tool { input_schema, name, allowed_callers, 7 more }
input_schema: InputSchema { type, properties, required } JSON schema for this tool's input.
JSON schema for this tool's input.
This defines the shape of the input that your tool accepts and that the model will produce.
name: stringName 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.
description?: stringDescription of what this tool does.
Description of what this tool does.
Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
When true, guarantees schema validation on tool names and inputs
ToolBash20250124 { name, type, allowed_callers, 4 more }
name: "bash"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
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
MemoryTool20250818 { name, type, allowed_callers, 4 more }
name: "memory"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
ToolTextEditor20250124 { name, type, allowed_callers, 4 more }
name: "str_replace_editor"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
ToolTextEditor20250429 { name, type, allowed_callers, 4 more }
name: "str_replace_based_edit_tool"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
ToolTextEditor20250728 { name, type, allowed_callers, 5 more }
name: "str_replace_based_edit_tool"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.
Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
When true, guarantees schema validation on tool names and inputs
WebSearchTool20250305 { name, type, allowed_callers, 7 more }
name: "web_search"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">
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
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.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
user_location?: UserLocation { type, city, country, 2 more } | nullParameters for the user's location. Used to provide more relevant search results.
Parameters for the user's location. Used to provide more relevant search results.
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
WebFetchTool20250910 { name, type, allowed_callers, 8 more }
name: "web_fetch"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">
List of domains to allow fetching from
List of domains to block fetching from
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 } | nullCitations configuration for fetched documents. Citations are disabled by default.
Citations configuration for fetched documents. Citations are disabled by default.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
WebSearchTool20260209 { name, type, allowed_callers, 7 more }
name: "web_search"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">
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
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.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
user_location?: UserLocation { type, city, country, 2 more } | nullParameters for the user's location. Used to provide more relevant search results.
Parameters for the user's location. Used to provide more relevant search results.
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
WebFetchTool20260209 { name, type, allowed_callers, 8 more }
name: "web_fetch"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">
List of domains to allow fetching from
List of domains to block fetching from
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 } | nullCitations configuration for fetched documents. Citations are disabled by default.
Citations configuration for fetched documents. Citations are disabled by default.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
ToolSearchToolBm25_20251119 { name, type, allowed_callers, 3 more }
name: "tool_search_tool_bm25"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
type: "tool_search_tool_bm25_20251119" | "tool_search_tool_bm25"
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
ToolSearchToolRegex20251119 { name, type, allowed_callers, 3 more }
name: "tool_search_tool_regex"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
type: "tool_search_tool_regex_20251119" | "tool_search_tool_regex"
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
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 }
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 }
URLImageSource { type, url }
URLPDFSource { type, url }
Usage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more }
cache_creation: CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } | nullBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
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.
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The geographic region where inference was performed for this request.
The number of input tokens which were used.
The number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
service_tier: "standard" | "priority" | "batch" | nullIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
UserLocation { type, city, country, 2 more }
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
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
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
WebFetchTool20250910 { name, type, allowed_callers, 8 more }
name: "web_fetch"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">
List of domains to allow fetching from
List of domains to block fetching from
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 } | nullCitations configuration for fetched documents. Citations are disabled by default.
Citations configuration for fetched documents. Citations are disabled by default.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
WebFetchTool20260209 { name, type, allowed_callers, 8 more }
name: "web_fetch"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">
List of domains to allow fetching from
List of domains to block fetching from
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 } | nullCitations configuration for fetched documents. Citations are disabled by default.
Citations configuration for fetched documents. Citations are disabled by default.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
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
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 }
WebFetchToolResultErrorBlock { error_code, type }
error_code: WebFetchToolResultErrorCode
WebFetchToolResultErrorBlockParam { error_code, type }
error_code: WebFetchToolResultErrorCode
WebFetchToolResultErrorCode = "invalid_tool_input" | "url_too_long" | "url_not_allowed" | 5 more
WebSearchResultBlock { encrypted_content, page_age, title, 2 more }
WebSearchResultBlockParam { encrypted_content, title, type, 2 more }
WebSearchTool20250305 { name, type, allowed_callers, 7 more }
name: "web_search"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">
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
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.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
user_location?: UserLocation { type, city, country, 2 more } | nullParameters for the user's location. Used to provide more relevant search results.
Parameters for the user's location. Used to provide more relevant search results.
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
WebSearchTool20260209 { name, type, allowed_callers, 7 more }
name: "web_search"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">
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
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.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
user_location?: UserLocation { type, city, country, 2 more } | nullParameters for the user's location. Used to provide more relevant search results.
Parameters for the user's location. Used to provide more relevant search results.
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
WebSearchToolRequestError { error_code, type }
error_code: WebSearchToolResultErrorCode
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 } >
WebSearchToolResultBlockContent = WebSearchToolResultError { error_code, type } | Array<WebSearchResultBlock { encrypted_content, page_age, title, 2 more } >
WebSearchToolResultError { error_code, type }
error_code: WebSearchToolResultErrorCode
Array<WebSearchResultBlock { encrypted_content, page_age, title, 2 more } >
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 }
WebSearchToolResultBlockParamContent = Array<WebSearchResultBlockParam { encrypted_content, title, type, 2 more } > | WebSearchToolRequestError { error_code, type }
Array<WebSearchResultBlockParam { encrypted_content, title, type, 2 more } >
WebSearchToolRequestError { error_code, type }
error_code: WebSearchToolResultErrorCode
WebSearchToolResultError { error_code, type }
error_code: WebSearchToolResultErrorCode
WebSearchToolResultErrorCode = "invalid_tool_input" | "unavailable" | "max_uses_exceeded" | 3 more
MessagesBatches
Create a Message Batch
Retrieve a Message Batch
List Message Batches
Cancel a Message Batch
Delete a Message Batch
Retrieve Message Batch results
ModelsExpand Collapse
DeletedMessageBatch { id, type }
ID of the Message Batch.
type: "message_batch_deleted"Deleted object type.
Deleted object type.
For Message Batches, this is always "message_batch_deleted".
MessageBatch { id, archived_at, cancel_initiated_at, 7 more }
id: stringUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
RFC 3339 datetime string representing the time at which the Message Batch was created.
ended_at: string | nullRFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
processing_status: "in_progress" | "canceling" | "ended"Processing status of the Message Batch.
Processing status of the Message Batch.
request_counts: MessageBatchRequestCounts { canceled, errored, expired, 2 more } Tallies requests within the Message Batch, categorized by their status.
Tallies requests within the Message Batch, categorized by their status.
Requests start as processing and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
canceled: numberNumber of requests in the Message Batch that have been canceled.
Number of requests in the Message Batch that have been canceled.
This is zero until processing of the entire Message Batch has ended.
errored: numberNumber of requests in the Message Batch that encountered an error.
Number of requests in the Message Batch that encountered an error.
This is zero until processing of the entire Message Batch has ended.
expired: numberNumber of requests in the Message Batch that have expired.
Number of requests in the Message Batch that have expired.
This is zero until processing of the entire Message Batch has ended.
Number of requests in the Message Batch that are processing.
succeeded: numberNumber of requests in the Message Batch that have completed successfully.
Number of requests in the Message Batch that have completed successfully.
This is zero until processing of the entire Message Batch has ended.
results_url: string | nullURL to a .jsonl file containing the results of the Message Batch requests. Specified only once processing ends.
URL to a .jsonl file containing the results of the Message Batch requests. Specified only once processing ends.
Results in the file are not guaranteed to be in the same order as requests. Use the custom_id field to match results to requests.
type: "message_batch"Object type.
Object type.
For Message Batches, this is always "message_batch".
MessageBatchCanceledResult { type }
MessageBatchErroredResult { error, type }
error: ErrorResponse { error, request_id, type }
error: ErrorObject
InvalidRequestError { message, type }
AuthenticationError { message, type }
BillingError { message, type }
PermissionError { message, type }
NotFoundError { message, type }
RateLimitError { message, type }
GatewayTimeoutError { message, type }
APIErrorObject { message, type }
OverloadedError { message, type }
MessageBatchExpiredResult { type }
MessageBatchIndividualResponse { custom_id, result } This is a single line in the response .jsonl file and does not represent the response as a whole.
This is a single line in the response .jsonl file and does not represent the response as a whole.
custom_id: stringDeveloper-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
Must be unique for each request within the Message Batch.
result: MessageBatchResultProcessing result for this request.
Processing result for this request.
Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
MessageBatchSucceededResult { message, type }
message: Message { id, container, content, 6 more }
id: stringUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
container: Container { id, expires_at } | nullInformation 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.
content: Array<ContentBlock>Content generated by the model.
Content generated by the model.
This is an array of content blocks, each of which has a type that determines its shape.
Example:
[{"type": "text", "text": "Hi, I'm Claude."}]
If the request input messages ended with an assistant turn, then the response content will continue directly from that last turn. You can use this to constrain the model's output.
For example, if the input messages were:
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("}
]
Then the response content might be:
[{"type": "text", "text": "B)"}]
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.
model: ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
"claude-opus-4-6" | "claude-sonnet-4-6" | "claude-opus-4-5-20251101" | 19 more
Most intelligent model for building agents and coding
Frontier intelligence at scale — built for coding, agents, and enterprise workflows
Premium model combining maximum intelligence with practical performance
Premium model combining maximum intelligence with practical performance
High-performance model with early extended thinking
High-performance model with early extended thinking
Fastest and most compact model for near-instant responsiveness
Our fastest model
Hybrid model, capable of near-instant responses and extended thinking
Hybrid model, capable of near-instant responses and extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
Our best model for real-world agents and coding
Our best model for real-world agents and coding
Our most capable model
Our most capable model
Our most capable model
Our most capable model
Excels at writing and complex tasks
Excels at writing and complex tasks
Our previous most fast and cost-effective
role: "assistant"Conversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
stop_reason: StopReason | nullThe reason that we stopped.
The reason that we stopped.
This may be one the following values:
"end_turn": the model reached a natural stopping point"max_tokens": we exceeded the requestedmax_tokensor the model's maximum"stop_sequence": one of your provided customstop_sequenceswas generated"tool_use": the model invoked one or more tools"pause_turn": we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue."refusal": when streaming classifiers intervene to handle potential policy violations
In non-streaming mode this value is always non-null. In streaming mode, it is null in the message_start event and non-null otherwise.
stop_sequence: string | nullWhich custom stop sequence was generated, if any.
Which custom stop sequence was generated, if any.
This value will be a non-null string if one of your custom stop sequences was generated.
type: "message"Object type.
Object type.
For Messages, this is always "message".
usage: Usage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more } Billing and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
cache_creation: CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } | nullBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
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.
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The geographic region where inference was performed for this request.
The number of input tokens which were used.
The number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
service_tier: "standard" | "priority" | "batch" | nullIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
MessageBatchErroredResult { error, type }
error: ErrorResponse { error, request_id, type }
error: ErrorObject
InvalidRequestError { message, type }
AuthenticationError { message, type }
BillingError { message, type }
PermissionError { message, type }
NotFoundError { message, type }
RateLimitError { message, type }
GatewayTimeoutError { message, type }
APIErrorObject { message, type }
OverloadedError { message, type }
MessageBatchCanceledResult { type }
MessageBatchExpiredResult { type }
MessageBatchRequestCounts { canceled, errored, expired, 2 more }
canceled: numberNumber of requests in the Message Batch that have been canceled.
Number of requests in the Message Batch that have been canceled.
This is zero until processing of the entire Message Batch has ended.
errored: numberNumber of requests in the Message Batch that encountered an error.
Number of requests in the Message Batch that encountered an error.
This is zero until processing of the entire Message Batch has ended.
expired: numberNumber of requests in the Message Batch that have expired.
Number of requests in the Message Batch that have expired.
This is zero until processing of the entire Message Batch has ended.
Number of requests in the Message Batch that are processing.
succeeded: numberNumber of requests in the Message Batch that have completed successfully.
Number of requests in the Message Batch that have completed successfully.
This is zero until processing of the entire Message Batch has ended.
MessageBatchResult = MessageBatchSucceededResult { message, type } | MessageBatchErroredResult { error, type } | MessageBatchCanceledResult { type } | MessageBatchExpiredResult { type } Processing result for this request.
Processing result for this request.
Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
MessageBatchSucceededResult { message, type }
message: Message { id, container, content, 6 more }
id: stringUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
container: Container { id, expires_at } | nullInformation 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.
content: Array<ContentBlock>Content generated by the model.
Content generated by the model.
This is an array of content blocks, each of which has a type that determines its shape.
Example:
[{"type": "text", "text": "Hi, I'm Claude."}]
If the request input messages ended with an assistant turn, then the response content will continue directly from that last turn. You can use this to constrain the model's output.
For example, if the input messages were:
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("}
]
Then the response content might be:
[{"type": "text", "text": "B)"}]
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.
model: ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
"claude-opus-4-6" | "claude-sonnet-4-6" | "claude-opus-4-5-20251101" | 19 more
Most intelligent model for building agents and coding
Frontier intelligence at scale — built for coding, agents, and enterprise workflows
Premium model combining maximum intelligence with practical performance
Premium model combining maximum intelligence with practical performance
High-performance model with early extended thinking
High-performance model with early extended thinking
Fastest and most compact model for near-instant responsiveness
Our fastest model
Hybrid model, capable of near-instant responses and extended thinking
Hybrid model, capable of near-instant responses and extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
Our best model for real-world agents and coding
Our best model for real-world agents and coding
Our most capable model
Our most capable model
Our most capable model
Our most capable model
Excels at writing and complex tasks
Excels at writing and complex tasks
Our previous most fast and cost-effective
role: "assistant"Conversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
stop_reason: StopReason | nullThe reason that we stopped.
The reason that we stopped.
This may be one the following values:
"end_turn": the model reached a natural stopping point"max_tokens": we exceeded the requestedmax_tokensor the model's maximum"stop_sequence": one of your provided customstop_sequenceswas generated"tool_use": the model invoked one or more tools"pause_turn": we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue."refusal": when streaming classifiers intervene to handle potential policy violations
In non-streaming mode this value is always non-null. In streaming mode, it is null in the message_start event and non-null otherwise.
stop_sequence: string | nullWhich custom stop sequence was generated, if any.
Which custom stop sequence was generated, if any.
This value will be a non-null string if one of your custom stop sequences was generated.
type: "message"Object type.
Object type.
For Messages, this is always "message".
usage: Usage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more } Billing and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
cache_creation: CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } | nullBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
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.
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The geographic region where inference was performed for this request.
The number of input tokens which were used.
The number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
service_tier: "standard" | "priority" | "batch" | nullIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
MessageBatchErroredResult { error, type }
error: ErrorResponse { error, request_id, type }
error: ErrorObject
InvalidRequestError { message, type }
AuthenticationError { message, type }
BillingError { message, type }
PermissionError { message, type }
NotFoundError { message, type }
RateLimitError { message, type }
GatewayTimeoutError { message, type }
APIErrorObject { message, type }
OverloadedError { message, type }
MessageBatchCanceledResult { type }
MessageBatchExpiredResult { type }
MessageBatchSucceededResult { message, type }
message: Message { id, container, content, 6 more }
id: stringUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
container: Container { id, expires_at } | nullInformation 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.
content: Array<ContentBlock>Content generated by the model.
Content generated by the model.
This is an array of content blocks, each of which has a type that determines its shape.
Example:
[{"type": "text", "text": "Hi, I'm Claude."}]
If the request input messages ended with an assistant turn, then the response content will continue directly from that last turn. You can use this to constrain the model's output.
For example, if the input messages were:
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("}
]
Then the response content might be:
[{"type": "text", "text": "B)"}]
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.
model: ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
"claude-opus-4-6" | "claude-sonnet-4-6" | "claude-opus-4-5-20251101" | 19 more
Most intelligent model for building agents and coding
Frontier intelligence at scale — built for coding, agents, and enterprise workflows
Premium model combining maximum intelligence with practical performance
Premium model combining maximum intelligence with practical performance
High-performance model with early extended thinking
High-performance model with early extended thinking
Fastest and most compact model for near-instant responsiveness
Our fastest model
Hybrid model, capable of near-instant responses and extended thinking
Hybrid model, capable of near-instant responses and extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
High-performance model with extended thinking
Our best model for real-world agents and coding
Our best model for real-world agents and coding
Our most capable model
Our most capable model
Our most capable model
Our most capable model
Excels at writing and complex tasks
Excels at writing and complex tasks
Our previous most fast and cost-effective
role: "assistant"Conversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
stop_reason: StopReason | nullThe reason that we stopped.
The reason that we stopped.
This may be one the following values:
"end_turn": the model reached a natural stopping point"max_tokens": we exceeded the requestedmax_tokensor the model's maximum"stop_sequence": one of your provided customstop_sequenceswas generated"tool_use": the model invoked one or more tools"pause_turn": we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue."refusal": when streaming classifiers intervene to handle potential policy violations
In non-streaming mode this value is always non-null. In streaming mode, it is null in the message_start event and non-null otherwise.
stop_sequence: string | nullWhich custom stop sequence was generated, if any.
Which custom stop sequence was generated, if any.
This value will be a non-null string if one of your custom stop sequences was generated.
type: "message"Object type.
Object type.
For Messages, this is always "message".
usage: Usage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 5 more } Billing and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
cache_creation: CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } | nullBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
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.
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The geographic region where inference was performed for this request.
The number of input tokens which were used.
The number of output tokens which were used.
server_tool_use: ServerToolUsage { web_fetch_requests, web_search_requests } | nullThe number of server tool requests.
The number of server tool requests.
The number of web fetch tool requests.
The number of web search tool requests.
service_tier: "standard" | "priority" | "batch" | nullIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.