Messages
Create a Message
Count tokens in a Message
ModelsExpand Collapse
class Base64ImageSource:
required MediaType MediaType
class Base64PdfSource:
class BashCodeExecutionOutputBlock:
class BashCodeExecutionOutputBlockParam:
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class BashCodeExecutionResultBlockParam:
required IReadOnlyList<BashCodeExecutionOutputBlockParam> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlockParam:
required Content Content
class BashCodeExecutionToolResultErrorParam:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlockParam:
required IReadOnlyList<BashCodeExecutionOutputBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
enum BashCodeExecutionToolResultErrorCode:
class BashCodeExecutionToolResultErrorParam:
required BashCodeExecutionToolResultErrorCode ErrorCode
class CacheControlEphemeral:
Ttl TtlThe 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.
class CacheCreation:
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.
class CitationCharLocation:
class CitationCharLocationParam:
class CitationContentBlockLocation:
class CitationContentBlockLocationParam:
class CitationPageLocation:
class CitationPageLocationParam:
class CitationSearchResultLocationParam:
class CitationWebSearchResultLocationParam:
class CitationsConfig:
class CitationsConfigParam:
class CitationsDelta:
required Citation Citation
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class CitationsSearchResultLocation:
class CitationsWebSearchResultLocation:
class CodeExecutionOutputBlock:
class CodeExecutionOutputBlockParam:
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class CodeExecutionResultBlockParam:
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
class CodeExecutionTool20250522:
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionTool20250825:
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionTool20260120:Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class CodeExecutionToolResultBlockContent: A class that can be one of several variants.union Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class CodeExecutionToolResultBlockParam:
required CodeExecutionToolResultBlockParamContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultErrorParam:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlockParam:
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
class EncryptedCodeExecutionResultBlockParam:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class CodeExecutionToolResultBlockParamContent: A class that can be one of several variants.union Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultErrorParam:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlockParam:
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
class EncryptedCodeExecutionResultBlockParam:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
enum CodeExecutionToolResultErrorCode:
class CodeExecutionToolResultErrorParam:
required CodeExecutionToolResultErrorCode ErrorCode
class Container: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.
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
class ContainerUploadBlockParam:A content block that represents a file to be uploaded to the container
Files uploaded via this block will be available in the container's input directory.
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ContentBlock: A class that can be one of several variants.union Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
class ContentBlockParam: A class that can be one of several variants.union Regular text content.
Regular text content.
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class DocumentBlockParam:
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
class SearchResultBlockParam:
required IReadOnlyList<TextBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam Citations
class ThinkingBlockParam:
class RedactedThinkingBlockParam:
class ToolUseBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ToolResultBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 Content
IReadOnlyList<Block>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class SearchResultBlockParam:
required IReadOnlyList<TextBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam Citations
class DocumentBlockParam:
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
class ToolReferenceBlockParam:Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ServerToolUseBlockParam:
required Name Name
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class WebSearchToolResultBlockParam:
required WebSearchToolResultBlockParamContent Content
IReadOnlyList<WebSearchResultBlockParam>
class WebSearchToolRequestError:
required WebSearchToolResultErrorCode ErrorCode
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class WebFetchToolResultBlockParam:
required Content Content
class WebFetchToolResultErrorBlockParam:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlockParam:
required DocumentBlockParam Content
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
Fetched content URL
ISO 8601 timestamp when the content was retrieved
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class CodeExecutionToolResultBlockParam:
required CodeExecutionToolResultBlockParamContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultErrorParam:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlockParam:
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
class EncryptedCodeExecutionResultBlockParam:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class BashCodeExecutionToolResultBlockParam:
required Content Content
class BashCodeExecutionToolResultErrorParam:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlockParam:
required IReadOnlyList<BashCodeExecutionOutputBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class TextEditorCodeExecutionToolResultBlockParam:
required Content Content
class TextEditorCodeExecutionToolResultErrorParam:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlockParam:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlockParam:
class TextEditorCodeExecutionStrReplaceResultBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ToolSearchToolResultBlockParam:
required Content Content
class ToolSearchToolResultErrorParam:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlockParam:
required IReadOnlyList<ToolReferenceBlockParam> ToolReferences
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ContainerUploadBlockParam:A content block that represents a file to be uploaded to the container
Files uploaded via this block will be available in the container's input directory.
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ContentBlockSourceContent: A class that can be one of several variants.union
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class DocumentBlock:
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
class DocumentBlockParam:
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlockParam:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class InputJsonDelta:
class JsonOutputFormat:
The JSON schema of the format
class MemoryTool20250818:
JsonElement Name "memory"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class Message:
required string IDUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
required Container? ContainerInformation 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.
required IReadOnlyList<ContentBlock> ContentContent 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)"}]
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
required Model ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
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
JsonElement Role "assistant"constantConversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
required StopReason? StopReasonThe 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.
required string? StopSequenceWhich 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.
JsonElement Type "message"constantObject type.
Object type.
For Messages, this is always "message".
required Usage UsageBilling 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.
required CacheCreation? CacheCreationBreakdown 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.
required ServerToolUsage? ServerToolUseThe 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.
required ServiceTier? ServiceTierIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
class MessageCountTokensTool: A class that can be one of several variants.union Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
class Tool:
required InputSchema InputSchemaJSON 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.
required string NameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
string DescriptionDescription 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
class ToolBash20250124:
JsonElement Name "bash"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionTool20250522:
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionTool20250825:
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionTool20260120:Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class MemoryTool20250818:
JsonElement Name "memory"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolTextEditor20250124:
JsonElement Name "str_replace_editor"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolTextEditor20250429:
JsonElement Name "str_replace_based_edit_tool"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolTextEditor20250728:
JsonElement Name "str_replace_based_edit_tool"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class WebSearchTool20250305:
JsonElement Name "web_search"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
UserLocation? UserLocationParameters 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.
class WebFetchTool20250910:
JsonElement Name "web_fetch"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
List of domains to allow fetching from
List of domains to block fetching from
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? CitationsCitations 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
class WebSearchTool20260209:
JsonElement Name "web_search"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
UserLocation? UserLocationParameters 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.
class WebFetchTool20260209:
JsonElement Name "web_fetch"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
List of domains to allow fetching from
List of domains to block fetching from
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? CitationsCitations 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
class ToolSearchToolBm25_20251119:
JsonElement Name "tool_search_tool_bm25"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
required Type Type
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolSearchToolRegex20251119:
JsonElement Name "tool_search_tool_regex"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
required Type Type
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class MessageDeltaUsage:
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.
required ServerToolUsage? ServerToolUseThe 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.
class MessageParam:
required Content Content
IReadOnlyList<ContentBlockParam>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class DocumentBlockParam:
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
class SearchResultBlockParam:
required IReadOnlyList<TextBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam Citations
class ThinkingBlockParam:
class RedactedThinkingBlockParam:
class ToolUseBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ToolResultBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 Content
IReadOnlyList<Block>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class SearchResultBlockParam:
required IReadOnlyList<TextBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam Citations
class DocumentBlockParam:
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
class ToolReferenceBlockParam:Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ServerToolUseBlockParam:
required Name Name
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class WebSearchToolResultBlockParam:
required WebSearchToolResultBlockParamContent Content
IReadOnlyList<WebSearchResultBlockParam>
class WebSearchToolRequestError:
required WebSearchToolResultErrorCode ErrorCode
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class WebFetchToolResultBlockParam:
required Content Content
class WebFetchToolResultErrorBlockParam:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlockParam:
required DocumentBlockParam Content
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
Fetched content URL
ISO 8601 timestamp when the content was retrieved
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class CodeExecutionToolResultBlockParam:
required CodeExecutionToolResultBlockParamContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultErrorParam:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlockParam:
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
class EncryptedCodeExecutionResultBlockParam:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class BashCodeExecutionToolResultBlockParam:
required Content Content
class BashCodeExecutionToolResultErrorParam:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlockParam:
required IReadOnlyList<BashCodeExecutionOutputBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class TextEditorCodeExecutionToolResultBlockParam:
required Content Content
class TextEditorCodeExecutionToolResultErrorParam:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlockParam:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlockParam:
class TextEditorCodeExecutionStrReplaceResultBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ToolSearchToolResultBlockParam:
required Content Content
class ToolSearchToolResultErrorParam:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlockParam:
required IReadOnlyList<ToolReferenceBlockParam> ToolReferences
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ContainerUploadBlockParam:A content block that represents a file to be uploaded to the container
Files uploaded via this block will be available in the container's input directory.
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
required Role Role
class MessageTokensCount:
The total number of tokens across the provided list of messages, system prompt, and tools.
class Metadata:
string? UserIDAn 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.
class OutputConfig:
Effort? EffortAll possible effort levels.
All possible effort levels.
JsonOutputFormat? FormatA 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
class PlainTextSource:
class RawContentBlockDelta: A class that can be one of several variants.union
class TextDelta:
class InputJsonDelta:
class CitationsDelta:
required Citation Citation
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingDelta:
class SignatureDelta:
class RawContentBlockDeltaEvent:
required RawContentBlockDelta Delta
class TextDelta:
class InputJsonDelta:
class CitationsDelta:
required Citation Citation
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingDelta:
class SignatureDelta:
class RawContentBlockStartEvent:
required ContentBlock ContentBlockResponse model for a file uploaded to the container.
Response model for a file uploaded to the container.
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
class RawContentBlockStopEvent:
class RawMessageDeltaEvent:
required Delta Delta
required Container? ContainerInformation 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.
required StopReason? StopReason
required MessageDeltaUsage UsageBilling 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.
required ServerToolUsage? ServerToolUseThe 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.
class RawMessageStartEvent:
required Message Message
required string IDUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
required Container? ContainerInformation 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.
required IReadOnlyList<ContentBlock> ContentContent 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)"}]
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
required Model ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
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
JsonElement Role "assistant"constantConversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
required StopReason? StopReasonThe 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.
required string? StopSequenceWhich 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.
JsonElement Type "message"constantObject type.
Object type.
For Messages, this is always "message".
required Usage UsageBilling 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.
required CacheCreation? CacheCreationBreakdown 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.
required ServerToolUsage? ServerToolUseThe 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.
required ServiceTier? ServiceTierIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
class RawMessageStopEvent:
class RawMessageStreamEvent: A class that can be one of several variants.union
class RawMessageStartEvent:
required Message Message
required string IDUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
required Container? ContainerInformation 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.
required IReadOnlyList<ContentBlock> ContentContent 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)"}]
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
required Model ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
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
JsonElement Role "assistant"constantConversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
required StopReason? StopReasonThe 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.
required string? StopSequenceWhich 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.
JsonElement Type "message"constantObject type.
Object type.
For Messages, this is always "message".
required Usage UsageBilling 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.
required CacheCreation? CacheCreationBreakdown 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.
required ServerToolUsage? ServerToolUseThe 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.
required ServiceTier? ServiceTierIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
class RawMessageDeltaEvent:
required Delta Delta
required Container? ContainerInformation 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.
required StopReason? StopReason
required MessageDeltaUsage UsageBilling 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.
required ServerToolUsage? ServerToolUseThe 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.
class RawMessageStopEvent:
class RawContentBlockStartEvent:
required ContentBlock ContentBlockResponse model for a file uploaded to the container.
Response model for a file uploaded to the container.
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
class RawContentBlockDeltaEvent:
required RawContentBlockDelta Delta
class TextDelta:
class InputJsonDelta:
class CitationsDelta:
required Citation Citation
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingDelta:
class SignatureDelta:
class RawContentBlockStopEvent:
class RedactedThinkingBlock:
class RedactedThinkingBlockParam:
class SearchResultBlockParam:
required IReadOnlyList<TextBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam Citations
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUsage:
The number of web fetch tool requests.
The number of web search tool requests.
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class ServerToolUseBlockParam:
required Name Name
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class SignatureDelta:
enum StopReason:
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class TextCitation: A class that can be one of several variants.union
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class TextCitationParam: A class that can be one of several variants.union
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class TextDelta:
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionCreateResultBlockParam:
class TextEditorCodeExecutionStrReplaceResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlockParam:
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class TextEditorCodeExecutionToolResultBlockParam:
required Content Content
class TextEditorCodeExecutionToolResultErrorParam:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlockParam:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlockParam:
class TextEditorCodeExecutionStrReplaceResultBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
enum TextEditorCodeExecutionToolResultErrorCode:
class TextEditorCodeExecutionToolResultErrorParam:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionViewResultBlockParam:
required FileType FileType
class ThinkingBlock:
class ThinkingBlockParam:
class ThinkingConfigAdaptive:
class ThinkingConfigDisabled:
class ThinkingConfigEnabled:
required Long BudgetTokensDetermines 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.
class ThinkingConfigParam: A class that can be one of several variants.union 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.
class ThinkingConfigEnabled:
required Long BudgetTokensDetermines 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.
class ThinkingConfigDisabled:
class ThinkingConfigAdaptive:
class ThinkingDelta:
class Tool:
required InputSchema InputSchemaJSON 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.
required string NameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
string DescriptionDescription 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
class ToolBash20250124:
JsonElement Name "bash"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolChoice: A class that can be one of several variants.union 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.
class ToolChoiceAuto:The model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
Boolean DisableParallelToolUseWhether 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.
class ToolChoiceAny:The model will use any available tools.
The model will use any available tools.
Boolean DisableParallelToolUseWhether 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.
class ToolChoiceTool: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.
Boolean DisableParallelToolUseWhether 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.
class ToolChoiceNone:The model will not be allowed to use tools.
The model will not be allowed to use tools.
class ToolChoiceAny:The model will use any available tools.
The model will use any available tools.
Boolean DisableParallelToolUseWhether 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.
class ToolChoiceAuto:The model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
Boolean DisableParallelToolUseWhether 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.
class ToolChoiceNone:The model will not be allowed to use tools.
The model will not be allowed to use tools.
class ToolChoiceTool: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.
Boolean DisableParallelToolUseWhether 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.
class ToolReferenceBlock:
class ToolReferenceBlockParam:Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ToolResultBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 Content
IReadOnlyList<Block>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class SearchResultBlockParam:
required IReadOnlyList<TextBlockParam> Content
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam Citations
class DocumentBlockParam:
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
class ToolReferenceBlockParam:Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ToolSearchToolBm25_20251119:
JsonElement Name "tool_search_tool_bm25"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
required Type Type
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolSearchToolRegex20251119:
JsonElement Name "tool_search_tool_regex"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
required Type Type
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ToolSearchToolResultBlockParam:
required Content Content
class ToolSearchToolResultErrorParam:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlockParam:
required IReadOnlyList<ToolReferenceBlockParam> ToolReferences
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
enum ToolSearchToolResultErrorCode:
class ToolSearchToolResultErrorParam:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ToolSearchToolSearchResultBlockParam:
required IReadOnlyList<ToolReferenceBlockParam> ToolReferences
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class ToolTextEditor20250124:
JsonElement Name "str_replace_editor"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolTextEditor20250429:
JsonElement Name "str_replace_based_edit_tool"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolTextEditor20250728:
JsonElement Name "str_replace_based_edit_tool"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolUnion: A class that can be one of several variants.union Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
class Tool:
required InputSchema InputSchemaJSON 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.
required string NameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
string DescriptionDescription 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
class ToolBash20250124:
JsonElement Name "bash"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionTool20250522:
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionTool20250825:
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class CodeExecutionTool20260120:Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
JsonElement Name "code_execution"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class MemoryTool20250818:
JsonElement Name "memory"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolTextEditor20250124:
JsonElement Name "str_replace_editor"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolTextEditor20250429:
JsonElement Name "str_replace_based_edit_tool"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolTextEditor20250728:
JsonElement Name "str_replace_based_edit_tool"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class WebSearchTool20250305:
JsonElement Name "web_search"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
UserLocation? UserLocationParameters 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.
class WebFetchTool20250910:
JsonElement Name "web_fetch"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
List of domains to allow fetching from
List of domains to block fetching from
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? CitationsCitations 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
class WebSearchTool20260209:
JsonElement Name "web_search"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
UserLocation? UserLocationParameters 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.
class WebFetchTool20260209:
JsonElement Name "web_fetch"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
List of domains to allow fetching from
List of domains to block fetching from
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? CitationsCitations 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
class ToolSearchToolBm25_20251119:
JsonElement Name "tool_search_tool_bm25"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
required Type Type
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolSearchToolRegex20251119:
JsonElement Name "tool_search_tool_regex"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
required Type Type
IReadOnlyList<AllowedCaller> AllowedCallers
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ToolUseBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class UrlImageSource:
class UrlPdfSource:
class Usage:
required CacheCreation? CacheCreationBreakdown 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.
required ServerToolUsage? ServerToolUseThe 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.
required ServiceTier? ServiceTierIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
class UserLocation:
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.
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class WebFetchBlockParam:
required DocumentBlockParam Content
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
Fetched content URL
ISO 8601 timestamp when the content was retrieved
class WebFetchTool20250910:
JsonElement Name "web_fetch"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
List of domains to allow fetching from
List of domains to block fetching from
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? CitationsCitations 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
class WebFetchTool20260209:
JsonElement Name "web_fetch"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
List of domains to allow fetching from
List of domains to block fetching from
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? CitationsCitations 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
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class WebFetchToolResultBlockParam:
required Content Content
class WebFetchToolResultErrorBlockParam:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlockParam:
required DocumentBlockParam Content
required Source Source
class Base64PdfSource:
class PlainTextSource:
class ContentBlockSource:
required Content Content
IReadOnlyList<ContentBlockSourceContent>
class TextBlockParam:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
IReadOnlyList<TextCitationParam>? Citations
class CitationCharLocationParam:
class CitationPageLocationParam:
class CitationContentBlockLocationParam:
class CitationWebSearchResultLocationParam:
class CitationSearchResultLocationParam:
class ImageBlockParam:
required Source Source
class Base64ImageSource:
required MediaType MediaType
class UrlImageSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
class UrlPdfSource:
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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.
CitationsConfigParam? Citations
Fetched content URL
ISO 8601 timestamp when the content was retrieved
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchToolResultErrorBlockParam:
required WebFetchToolResultErrorCode ErrorCode
enum WebFetchToolResultErrorCode:
class WebSearchResultBlock:
class WebSearchResultBlockParam:
class WebSearchTool20250305:
JsonElement Name "web_search"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
UserLocation? UserLocationParameters 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.
class WebSearchTool20260209:
JsonElement Name "web_search"constantName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
IReadOnlyList<AllowedCaller> AllowedCallers
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.
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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
UserLocation? UserLocationParameters 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.
class WebSearchToolRequestError:
required WebSearchToolResultErrorCode ErrorCode
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebSearchToolResultBlockContent: A class that can be one of several variants.union
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebSearchToolResultBlockParam:
required WebSearchToolResultBlockParamContent Content
IReadOnlyList<WebSearchResultBlockParam>
class WebSearchToolRequestError:
required WebSearchToolResultErrorCode ErrorCode
CacheControlEphemeral? CacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Ttl TtlThe 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 CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class WebSearchToolResultBlockParamContent: A class that can be one of several variants.union
IReadOnlyList<WebSearchResultBlockParam>
class WebSearchToolRequestError:
required WebSearchToolResultErrorCode ErrorCode
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
enum WebSearchToolResultErrorCode:
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
class DeletedMessageBatch:
ID of the Message Batch.
JsonElement Type "message_batch_deleted"constantDeleted object type.
Deleted object type.
For Message Batches, this is always "message_batch_deleted".
class MessageBatch:
required string IDUnique 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.
required DateTimeOffset? EndedAtRFC 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.
required ProcessingStatus ProcessingStatusProcessing status of the Message Batch.
Processing status of the Message Batch.
required MessageBatchRequestCounts RequestCountsTallies 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.
required Long CanceledNumber 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.
required Long ErroredNumber 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.
required Long ExpiredNumber 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.
required Long SucceededNumber 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.
required string? ResultsUrlURL 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.
JsonElement Type "message_batch"constantObject type.
Object type.
For Message Batches, this is always "message_batch".
class MessageBatchCanceledResult:
class MessageBatchErroredResult:
required ErrorResponse Error
required ErrorObject Error
class InvalidRequestError:
class AuthenticationError:
class BillingError:
class PermissionError:
class NotFoundError:
class RateLimitError:
class GatewayTimeoutError:
class ApiErrorObject:
class OverloadedError:
class MessageBatchExpiredResult:
class MessageBatchIndividualResponse: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.
required string CustomIDDeveloper-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.
required MessageBatchResult ResultProcessing 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.
class MessageBatchSucceededResult:
required Message Message
required string IDUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
required Container? ContainerInformation 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.
required IReadOnlyList<ContentBlock> ContentContent 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)"}]
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
required Model ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
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
JsonElement Role "assistant"constantConversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
required StopReason? StopReasonThe 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.
required string? StopSequenceWhich 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.
JsonElement Type "message"constantObject type.
Object type.
For Messages, this is always "message".
required Usage UsageBilling 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.
required CacheCreation? CacheCreationBreakdown 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.
required ServerToolUsage? ServerToolUseThe 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.
required ServiceTier? ServiceTierIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
class MessageBatchErroredResult:
required ErrorResponse Error
required ErrorObject Error
class InvalidRequestError:
class AuthenticationError:
class BillingError:
class PermissionError:
class NotFoundError:
class RateLimitError:
class GatewayTimeoutError:
class ApiErrorObject:
class OverloadedError:
class MessageBatchCanceledResult:
class MessageBatchExpiredResult:
class MessageBatchRequestCounts:
required Long CanceledNumber 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.
required Long ErroredNumber 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.
required Long ExpiredNumber 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.
required Long SucceededNumber 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.
class MessageBatchResult: A class that can be one of several variants.union 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.
class MessageBatchSucceededResult:
required Message Message
required string IDUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
required Container? ContainerInformation 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.
required IReadOnlyList<ContentBlock> ContentContent 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)"}]
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
required Model ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
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
JsonElement Role "assistant"constantConversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
required StopReason? StopReasonThe 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.
required string? StopSequenceWhich 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.
JsonElement Type "message"constantObject type.
Object type.
For Messages, this is always "message".
required Usage UsageBilling 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.
required CacheCreation? CacheCreationBreakdown 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.
required ServerToolUsage? ServerToolUseThe 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.
required ServiceTier? ServiceTierIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.
class MessageBatchErroredResult:
required ErrorResponse Error
required ErrorObject Error
class InvalidRequestError:
class AuthenticationError:
class BillingError:
class PermissionError:
class NotFoundError:
class RateLimitError:
class GatewayTimeoutError:
class ApiErrorObject:
class OverloadedError:
class MessageBatchCanceledResult:
class MessageBatchExpiredResult:
class MessageBatchSucceededResult:
required Message Message
required string IDUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
required Container? ContainerInformation 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.
required IReadOnlyList<ContentBlock> ContentContent 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)"}]
class TextBlock:
required IReadOnlyList<TextCitation>? CitationsCitations 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.
class CitationCharLocation:
class CitationPageLocation:
class CitationContentBlockLocation:
class CitationsWebSearchResultLocation:
class CitationsSearchResultLocation:
class ThinkingBlock:
class RedactedThinkingBlock:
class ToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
class ServerToolUseBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Name Name
class WebSearchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required WebSearchToolResultBlockContent Content
class WebSearchToolResultError:
required WebSearchToolResultErrorCode ErrorCode
IReadOnlyList<WebSearchResultBlock>
class WebFetchToolResultBlock:
required Caller CallerTool invocation directly from the model.
Tool invocation directly from the model.
class DirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
class ServerToolCaller20260120:
required Content Content
class WebFetchToolResultErrorBlock:
required WebFetchToolResultErrorCode ErrorCode
class WebFetchBlock:
required DocumentBlock Content
required CitationsConfig? CitationsCitation configuration for the document
Citation configuration for the document
required Source Source
class Base64PdfSource:
class PlainTextSource:
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class CodeExecutionToolResultBlock:
required CodeExecutionToolResultBlockContent ContentCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class CodeExecutionToolResultError:
required CodeExecutionToolResultErrorCode ErrorCode
class CodeExecutionResultBlock:
required IReadOnlyList<CodeExecutionOutputBlock> Content
class EncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
required IReadOnlyList<CodeExecutionOutputBlock> Content
class BashCodeExecutionToolResultBlock:
required Content Content
class BashCodeExecutionToolResultError:
required BashCodeExecutionToolResultErrorCode ErrorCode
class BashCodeExecutionResultBlock:
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
class TextEditorCodeExecutionToolResultBlock:
required Content Content
class TextEditorCodeExecutionToolResultError:
required TextEditorCodeExecutionToolResultErrorCode ErrorCode
class TextEditorCodeExecutionViewResultBlock:
required FileType FileType
class TextEditorCodeExecutionCreateResultBlock:
class TextEditorCodeExecutionStrReplaceResultBlock:
class ToolSearchToolResultBlock:
required Content Content
class ToolSearchToolResultError:
required ToolSearchToolResultErrorCode ErrorCode
class ToolSearchToolSearchResultBlock:
required IReadOnlyList<ToolReferenceBlock> ToolReferences
class ContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
required Model ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
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
JsonElement Role "assistant"constantConversational role of the generated message.
Conversational role of the generated message.
This will always be "assistant".
required StopReason? StopReasonThe 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.
required string? StopSequenceWhich 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.
JsonElement Type "message"constantObject type.
Object type.
For Messages, this is always "message".
required Usage UsageBilling 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.
required CacheCreation? CacheCreationBreakdown 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.
required ServerToolUsage? ServerToolUseThe 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.
required ServiceTier? ServiceTierIf the request used the priority, standard, or batch tier.
If the request used the priority, standard, or batch tier.