Beta
ModelsExpand Collapse
AnthropicBeta = (string & {}) | "message-batches-2024-09-24" | "prompt-caching-2024-07-31" | "computer-use-2024-10-22" | 17 more
"message-batches-2024-09-24" | "prompt-caching-2024-07-31" | "computer-use-2024-10-22" | 17 more
BetaAPIError { message, type }
BetaAuthenticationError { message, type }
BetaBillingError { message, type }
BetaError = BetaInvalidRequestError { message, type } | BetaAuthenticationError { message, type } | BetaBillingError { message, type } | 6 more
BetaInvalidRequestError { message, type }
BetaAuthenticationError { message, type }
BetaBillingError { message, type }
BetaPermissionError { message, type }
BetaNotFoundError { message, type }
BetaRateLimitError { message, type }
BetaGatewayTimeoutError { message, type }
BetaAPIError { message, type }
BetaOverloadedError { message, type }
BetaErrorResponse { error, request_id, type }
error: BetaError
BetaInvalidRequestError { message, type }
BetaAuthenticationError { message, type }
BetaBillingError { message, type }
BetaPermissionError { message, type }
BetaNotFoundError { message, type }
BetaRateLimitError { message, type }
BetaGatewayTimeoutError { message, type }
BetaAPIError { message, type }
BetaOverloadedError { message, type }
BetaGatewayTimeoutError { message, type }
BetaInvalidRequestError { message, type }
BetaNotFoundError { message, type }
BetaOverloadedError { message, type }
BetaPermissionError { message, type }
BetaRateLimitError { message, type }
BetaModels
List Models
Get a Model
ModelsExpand Collapse
BetaModelInfo { id, created_at, display_name, type }
Unique model identifier.
RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
A human-readable name for the model.
type: "model"Object type.
Object type.
For Models, this is always "model".
BetaMessages
Create a Message
Count tokens in a Message
ModelsExpand Collapse
BetaAllThinkingTurns { type }
BetaBase64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
BetaBase64PDFSource { data, media_type, type }
BetaBashCodeExecutionOutputBlock { file_id, type }
BetaBashCodeExecutionOutputBlockParam { file_id, type }
BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BetaBashCodeExecutionOutputBlock { file_id, type } >
BetaBashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<BetaBashCodeExecutionOutputBlockParam { file_id, type } >
BetaBashCodeExecutionToolResultBlock { content, tool_use_id, type }
content: BetaBashCodeExecutionToolResultError { error_code, type } | BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
BetaBashCodeExecutionToolResultError { error_code, type }
error_code: "invalid_tool_input" | "unavailable" | "too_many_requests" | 2 more
BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BetaBashCodeExecutionOutputBlock { file_id, type } >
BetaBashCodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
content: BetaBashCodeExecutionToolResultErrorParam { error_code, type } | BetaBashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
BetaBashCodeExecutionToolResultErrorParam { error_code, type }
error_code: "invalid_tool_input" | "unavailable" | "too_many_requests" | 2 more
BetaBashCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<BetaBashCodeExecutionOutputBlockParam { file_id, type } >
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaBashCodeExecutionToolResultError { error_code, type }
error_code: "invalid_tool_input" | "unavailable" | "too_many_requests" | 2 more
BetaBashCodeExecutionToolResultErrorParam { error_code, type }
error_code: "invalid_tool_input" | "unavailable" | "too_many_requests" | 2 more
BetaCacheControlEphemeral { type, ttl }
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaCacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }
The number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 5 minute cache entry.
BetaCitationCharLocation { cited_text, document_index, document_title, 4 more }
BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationConfig { enabled }
BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationPageLocation { cited_text, document_index, document_title, 4 more }
BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
BetaCitationsConfigParam { enabled }
BetaCitationsDelta { citation, type }
citation: BetaCitationCharLocation { cited_text, document_index, document_title, 4 more } | BetaCitationPageLocation { cited_text, document_index, document_title, 4 more } | BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more } | 2 more
BetaCitationCharLocation { cited_text, document_index, document_title, 4 more }
BetaCitationPageLocation { cited_text, document_index, document_title, 4 more }
BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
BetaCitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
BetaCitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
BetaClearThinking20251015Edit { type, keep }
keep?: BetaThinkingTurns { type, value } | BetaAllThinkingTurns { type } | "all"Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
BetaThinkingTurns { type, value }
BetaAllThinkingTurns { type }
"all"
BetaClearThinking20251015EditResponse { cleared_input_tokens, cleared_thinking_turns, type }
Number of input tokens cleared by this edit.
Number of thinking turns that were cleared.
The type of context management edit applied.
BetaClearToolUses20250919Edit { type, clear_at_least, clear_tool_inputs, 3 more }
clear_at_least?: BetaInputTokensClearAtLeast { type, value } | nullMinimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
clear_tool_inputs?: boolean | Array<string> | nullWhether to clear all tool inputs (bool) or specific tool inputs to clear (list)
Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
Tool names whose uses are preserved from clearing
keep?: BetaToolUsesKeep { type, value } Number of tool uses to retain in the conversation
Number of tool uses to retain in the conversation
trigger?: BetaInputTokensTrigger { type, value } | BetaToolUsesTrigger { type, value } Condition that triggers the context management strategy
Condition that triggers the context management strategy
BetaInputTokensTrigger { type, value }
BetaToolUsesTrigger { type, value }
BetaClearToolUses20250919EditResponse { cleared_input_tokens, cleared_tool_uses, type }
Number of input tokens cleared by this edit.
Number of tool uses that were cleared.
The type of context management edit applied.
BetaCodeExecutionOutputBlock { file_id, type }
BetaCodeExecutionOutputBlockParam { file_id, type }
BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BetaCodeExecutionOutputBlock { file_id, type } >
BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<BetaCodeExecutionOutputBlockParam { file_id, type } >
BetaCodeExecutionTool20250522 { name, type, allowed_callers, 3 more }
name: "code_execution"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
allowed_callers?: Array<"direct" | "code_execution_20250825" | "code_execution_20260120">
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
BetaCodeExecutionTool20250825 { name, type, allowed_callers, 3 more }
name: "code_execution"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
allowed_callers?: Array<"direct" | "code_execution_20250825" | "code_execution_20260120">
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
BetaCodeExecutionTool20260120 { name, type, allowed_callers, 3 more } Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
name: "code_execution"Name of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
allowed_callers?: Array<"direct" | "code_execution_20250825" | "code_execution_20260120">
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
BetaCodeExecutionToolResultBlock { content, tool_use_id, type }
Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
BetaCodeExecutionToolResultError { error_code, type }
error_code: BetaCodeExecutionToolResultErrorCode
BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BetaCodeExecutionOutputBlock { file_id, type } >
BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<BetaCodeExecutionOutputBlock { file_id, type } >
BetaCodeExecutionToolResultBlockContent = BetaCodeExecutionToolResultError { error_code, type } | BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more } | BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
BetaCodeExecutionToolResultError { error_code, type }
error_code: BetaCodeExecutionToolResultErrorCode
BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BetaCodeExecutionOutputBlock { file_id, type } >
BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<BetaCodeExecutionOutputBlock { file_id, type } >
BetaCodeExecutionToolResultBlockParam { content, tool_use_id, type, cache_control }
Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
BetaCodeExecutionToolResultErrorParam { error_code, type }
error_code: BetaCodeExecutionToolResultErrorCode
BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<BetaCodeExecutionOutputBlockParam { file_id, type } >
BetaEncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<BetaCodeExecutionOutputBlockParam { file_id, type } >
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaCodeExecutionToolResultBlockParamContent = BetaCodeExecutionToolResultErrorParam { error_code, type } | BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more } | BetaEncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
BetaCodeExecutionToolResultErrorParam { error_code, type }
error_code: BetaCodeExecutionToolResultErrorCode
BetaCodeExecutionResultBlockParam { content, return_code, stderr, 2 more }
content: Array<BetaCodeExecutionOutputBlockParam { file_id, type } >
BetaEncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<BetaCodeExecutionOutputBlockParam { file_id, type } >
BetaCodeExecutionToolResultError { error_code, type }
error_code: BetaCodeExecutionToolResultErrorCode
BetaCodeExecutionToolResultErrorCode = "invalid_tool_input" | "unavailable" | "too_many_requests" | "execution_time_exceeded"
BetaCodeExecutionToolResultErrorParam { error_code, type }
error_code: BetaCodeExecutionToolResultErrorCode
BetaCompact20260112Edit { type, instructions, pause_after_compaction, trigger } Automatically compact older context when reaching the configured trigger threshold.
Automatically compact older context when reaching the configured trigger threshold.
Additional instructions for summarization.
Whether to pause after compaction and return the compaction block to the user.
trigger?: BetaInputTokensTrigger { type, value } | nullWhen to trigger compaction. Defaults to 150000 input tokens.
When to trigger compaction. Defaults to 150000 input tokens.
BetaCompactionBlock { content, type } A compaction block returned when autocompact is triggered.
A compaction block returned when autocompact is triggered.
When content is None, it indicates the compaction failed to produce a valid summary (e.g., malformed output from the model). Clients may round-trip compaction blocks with null content; the server treats them as no-ops.
Summary of compacted content, or null if compaction failed
BetaCompactionBlockParam { content, type, cache_control } A compaction block containing summary of previous context.
A compaction block containing summary of previous context.
Users should round-trip these blocks from responses to subsequent requests to maintain context across compaction boundaries.
When content is None, the block represents a failed compaction. The server treats these as no-ops. Empty string content is not allowed.
Summary of previously compacted content, or null if compaction failed
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaCompactionContentBlockDelta { content, type }
BetaCompactionIterationUsage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 3 more } Token usage for a compaction iteration.
Token usage for a compaction iteration.
cache_creation: BetaCacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens } | nullBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
The number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 5 minute cache entry.
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The number of input tokens which were used.
The number of output tokens which were used.
Usage for a compaction iteration
BetaContainer { id, expires_at, skills } 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.
skills: Array<BetaSkill { skill_id, type, version } > | nullSkills loaded in the container
Skills loaded in the container
Skill ID
type: "anthropic" | "custom"Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Skill version or 'latest' for most recent version
BetaContainerParams { id, skills } Container parameters with skills to be loaded.
Container parameters with skills to be loaded.
Container id
skills?: Array<BetaSkillParams { skill_id, type, version } > | nullList of skills to load in the container
List of skills to load in the container
Skill ID
type: "anthropic" | "custom"Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Skill version or 'latest' for most recent version
BetaContainerUploadBlock { file_id, type } Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
BetaContainerUploadBlockParam { file_id, type, cache_control } A content block that represents a file to be uploaded to the container
Files uploaded via this block will be available in the container's input directory.
A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory.
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaContentBlock = BetaTextBlock { citations, text, type } | BetaThinkingBlock { signature, thinking, type } | BetaRedactedThinkingBlock { data, type } | 12 moreResponse model for a file uploaded to the container.
Response model for a file uploaded to the container.
BetaTextBlock { citations, text, type }
citations: Array<BetaTextCitation> | nullCitations supporting the text block.
Citations supporting the text block.
The type of citation returned will depend on the type of document being cited. Citing a PDF results in page_location, plain text results in char_location, and content document results in content_block_location.
BetaCitationCharLocation { cited_text, document_index, document_title, 4 more }
BetaCitationPageLocation { cited_text, document_index, document_title, 4 more }
BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
BetaCitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
BetaThinkingBlock { signature, thinking, type }
BetaRedactedThinkingBlock { data, type }
BetaToolUseBlock { id, input, name, 2 more }
caller?: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaDirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
BetaServerToolCaller20260120 { tool_id, type }
BetaServerToolUseBlock { id, input, name, 2 more }
name: "web_search" | "web_fetch" | "code_execution" | 4 more
caller?: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaDirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
BetaServerToolCaller20260120 { tool_id, type }
BetaWebSearchToolResultBlock { content, tool_use_id, type, caller }
content: BetaWebSearchToolResultBlockContent
BetaWebSearchToolResultError { error_code, type }
error_code: BetaWebSearchToolResultErrorCode
Array<BetaWebSearchResultBlock { encrypted_content, page_age, title, 2 more } >
caller?: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaDirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
BetaServerToolCaller20260120 { tool_id, type }
BetaWebFetchToolResultBlock { content, tool_use_id, type, caller }
content: BetaWebFetchToolResultErrorBlock { error_code, type } | BetaWebFetchBlock { content, retrieved_at, type, url }
BetaWebFetchToolResultErrorBlock { error_code, type }
error_code: BetaWebFetchToolResultErrorCode
BetaWebFetchBlock { content, retrieved_at, type, url }
content: BetaDocumentBlock { citations, source, title, type }
citations: BetaCitationConfig { enabled } | nullCitation configuration for the document
Citation configuration for the document
source: BetaBase64PDFSource { data, media_type, type } | BetaPlainTextSource { data, media_type, type }
BetaBase64PDFSource { data, media_type, type }
BetaPlainTextSource { data, media_type, type }
The title of the document
ISO 8601 timestamp when the content was retrieved
Fetched content URL
caller?: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaDirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
BetaServerToolCaller20260120 { tool_id, type }
BetaCodeExecutionToolResultBlock { content, tool_use_id, type }
Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
BetaCodeExecutionToolResultError { error_code, type }
error_code: BetaCodeExecutionToolResultErrorCode
BetaCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BetaCodeExecutionOutputBlock { file_id, type } >
BetaEncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more } Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array<BetaCodeExecutionOutputBlock { file_id, type } >
BetaBashCodeExecutionToolResultBlock { content, tool_use_id, type }
content: BetaBashCodeExecutionToolResultError { error_code, type } | BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
BetaBashCodeExecutionToolResultError { error_code, type }
error_code: "invalid_tool_input" | "unavailable" | "too_many_requests" | 2 more
BetaBashCodeExecutionResultBlock { content, return_code, stderr, 2 more }
content: Array<BetaBashCodeExecutionOutputBlock { file_id, type } >
BetaTextEditorCodeExecutionToolResultBlock { content, tool_use_id, type }
content: BetaTextEditorCodeExecutionToolResultError { error_code, error_message, type } | BetaTextEditorCodeExecutionViewResultBlock { content, file_type, num_lines, 3 more } | BetaTextEditorCodeExecutionCreateResultBlock { is_file_update, type } | BetaTextEditorCodeExecutionStrReplaceResultBlock { lines, new_lines, new_start, 3 more }
BetaTextEditorCodeExecutionToolResultError { error_code, error_message, type }
error_code: "invalid_tool_input" | "unavailable" | "too_many_requests" | 2 more
BetaTextEditorCodeExecutionViewResultBlock { content, file_type, num_lines, 3 more }
file_type: "text" | "image" | "pdf"
BetaTextEditorCodeExecutionCreateResultBlock { is_file_update, type }
BetaTextEditorCodeExecutionStrReplaceResultBlock { lines, new_lines, new_start, 3 more }
BetaToolSearchToolResultBlock { content, tool_use_id, type }
content: BetaToolSearchToolResultError { error_code, error_message, type } | BetaToolSearchToolSearchResultBlock { tool_references, type }
BetaToolSearchToolResultError { error_code, error_message, type }
error_code: "invalid_tool_input" | "unavailable" | "too_many_requests" | "execution_time_exceeded"
BetaToolSearchToolSearchResultBlock { tool_references, type }
tool_references: Array<BetaToolReferenceBlock { tool_name, type } >
BetaMCPToolUseBlock { id, input, name, 2 more }
The name of the MCP tool
The name of the MCP server
BetaMCPToolResultBlock { content, is_error, tool_use_id, type }
content: string | Array<BetaTextBlock { citations, text, type } >
Array<BetaTextBlock { citations, text, type } >
citations: Array<BetaTextCitation> | nullCitations supporting the text block.
Citations supporting the text block.
The type of citation returned will depend on the type of document being cited. Citing a PDF results in page_location, plain text results in char_location, and content document results in content_block_location.
BetaCitationCharLocation { cited_text, document_index, document_title, 4 more }
BetaCitationPageLocation { cited_text, document_index, document_title, 4 more }
BetaCitationContentBlockLocation { cited_text, document_index, document_title, 4 more }
BetaCitationsWebSearchResultLocation { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocation { cited_text, end_block_index, search_result_index, 4 more }
BetaContainerUploadBlock { file_id, type } Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
BetaCompactionBlock { content, type } A compaction block returned when autocompact is triggered.
A compaction block returned when autocompact is triggered.
When content is None, it indicates the compaction failed to produce a valid summary (e.g., malformed output from the model). Clients may round-trip compaction blocks with null content; the server treats them as no-ops.
Summary of compacted content, or null if compaction failed
BetaContentBlockParam = BetaTextBlockParam { text, type, cache_control, citations } | BetaImageBlockParam { source, type, cache_control } | BetaRequestDocumentBlock { source, type, cache_control, 3 more } | 16 moreRegular text content.
Regular text content.
BetaTextBlockParam { text, type, cache_control, citations }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<BetaTextCitationParam> | null
BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
BetaImageBlockParam { source, type, cache_control }
source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
BetaBase64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
BetaURLImageSource { type, url }
BetaFileImageSource { file_id, type }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaRequestDocumentBlock { source, type, cache_control, 3 more }
source: BetaBase64PDFSource { data, media_type, type } | BetaPlainTextSource { data, media_type, type } | BetaContentBlockSource { content, type } | 2 more
BetaBase64PDFSource { data, media_type, type }
BetaPlainTextSource { data, media_type, type }
BetaContentBlockSource { content, type }
content: string | Array<BetaContentBlockSourceContent>
BetaTextBlockParam { text, type, cache_control, citations }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<BetaTextCitationParam> | null
BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
BetaImageBlockParam { source, type, cache_control }
source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
BetaBase64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
BetaURLImageSource { type, url }
BetaFileImageSource { file_id, type }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaURLPDFSource { type, url }
BetaFileDocumentSource { file_id, type }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: BetaCitationsConfigParam { enabled } | null
BetaSearchResultBlockParam { content, source, title, 3 more }
content: Array<BetaTextBlockParam { text, type, cache_control, citations } >
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<BetaTextCitationParam> | null
BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: BetaCitationsConfigParam { enabled }
BetaThinkingBlockParam { signature, thinking, type }
BetaRedactedThinkingBlockParam { data, type }
BetaToolUseBlockParam { id, input, name, 3 more }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
caller?: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaDirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
BetaServerToolCaller20260120 { tool_id, type }
BetaToolResultBlockParam { tool_use_id, type, cache_control, 2 more }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
content?: string | Array<BetaTextBlockParam { text, type, cache_control, citations } | BetaImageBlockParam { source, type, cache_control } | BetaSearchResultBlockParam { content, source, title, 3 more } | 2 more>
Array<BetaTextBlockParam { text, type, cache_control, citations } | BetaImageBlockParam { source, type, cache_control } | BetaSearchResultBlockParam { content, source, title, 3 more } | 2 more>
BetaTextBlockParam { text, type, cache_control, citations }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<BetaTextCitationParam> | null
BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
BetaImageBlockParam { source, type, cache_control }
source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
BetaBase64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
BetaURLImageSource { type, url }
BetaFileImageSource { file_id, type }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaSearchResultBlockParam { content, source, title, 3 more }
content: Array<BetaTextBlockParam { text, type, cache_control, citations } >
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<BetaTextCitationParam> | null
BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: BetaCitationsConfigParam { enabled }
BetaRequestDocumentBlock { source, type, cache_control, 3 more }
source: BetaBase64PDFSource { data, media_type, type } | BetaPlainTextSource { data, media_type, type } | BetaContentBlockSource { content, type } | 2 more
BetaBase64PDFSource { data, media_type, type }
BetaPlainTextSource { data, media_type, type }
BetaContentBlockSource { content, type }
content: string | Array<BetaContentBlockSourceContent>
BetaTextBlockParam { text, type, cache_control, citations }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<BetaTextCitationParam> | null
BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
BetaImageBlockParam { source, type, cache_control }
source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
BetaBase64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
BetaURLImageSource { type, url }
BetaFileImageSource { file_id, type }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaURLPDFSource { type, url }
BetaFileDocumentSource { file_id, type }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: BetaCitationsConfigParam { enabled } | null
BetaToolReferenceBlockParam { tool_name, type, cache_control } Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaServerToolUseBlockParam { id, input, name, 3 more }
name: "web_search" | "web_fetch" | "code_execution" | 4 more
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
caller?: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaDirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
BetaServerToolCaller20260120 { tool_id, type }
BetaWebSearchToolResultBlockParam { content, tool_use_id, type, 2 more }
Array<BetaWebSearchResultBlockParam { encrypted_content, title, type, 2 more } >
BetaWebSearchToolRequestError { error_code, type }
error_code: BetaWebSearchToolResultErrorCode
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
caller?: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaDirectCaller { type } Tool invocation directly from the model.
Tool invocation directly from the model.
BetaServerToolCaller { tool_id, type } Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
BetaServerToolCaller20260120 { tool_id, type }
BetaWebFetchToolResultBlockParam { content, tool_use_id, type, 2 more }
content: BetaWebFetchToolResultErrorBlockParam { error_code, type } | BetaWebFetchBlockParam { content, type, url, retrieved_at }
BetaWebFetchToolResultErrorBlockParam { error_code, type }
error_code: BetaWebFetchToolResultErrorCode
BetaWebFetchBlockParam { content, type, url, retrieved_at }
content: BetaRequestDocumentBlock { source, type, cache_control, 3 more }
source: BetaBase64PDFSource { data, media_type, type } | BetaPlainTextSource { data, media_type, type } | BetaContentBlockSource { content, type } | 2 more
BetaBase64PDFSource { data, media_type, type }
BetaPlainTextSource { data, media_type, type }
BetaContentBlockSource { content, type }
content: string | Array<BetaContentBlockSourceContent>
BetaTextBlockParam { text, type, cache_control, citations }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: Array<BetaTextCitationParam> | null
BetaCitationCharLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationPageLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more }
BetaCitationWebSearchResultLocationParam { cited_text, encrypted_index, title, 2 more }
BetaCitationSearchResultLocationParam { cited_text, end_block_index, search_result_index, 4 more }
BetaImageBlockParam { source, type, cache_control }
source: BetaBase64ImageSource { data, media_type, type } | BetaURLImageSource { type, url } | BetaFileImageSource { file_id, type }
BetaBase64ImageSource { data, media_type, type }
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
BetaURLImageSource { type, url }
BetaFileImageSource { file_id, type }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
BetaURLPDFSource { type, url }
BetaFileDocumentSource { file_id, type }
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
citations?: BetaCitationsConfigParam { enabled } | null
Fetched content URL
ISO 8601 timestamp when the content was retrieved
cache_control?: BetaCacheControlEphemeral { type, ttl } | nullCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl?: "5m" | "1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m.
caller?: BetaDirectCaller { type } | BetaServerToolCaller { tool_id, type } | BetaServerToolCaller20260120 { tool_id, type } Tool invocation directly from the model.
Tool invocation directly from the model.