Messages
Create a Message
messages.create(**kwargs) -> MessageSend a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
Count tokens in a Message
messages.count_tokens(**kwargs) -> MessageTokensCountCount the number of tokens in a Message.
Models
class Base64ImageSource { type, data, media_type }
data: String
media_type: :"image/jpeg" | :"image/png" | :"image/gif" | :"image/webp"
class Base64PDFSource { type, data, media_type }
data: String
class BashCodeExecutionOutputBlock { type, file_id }
class BashCodeExecutionOutputBlockParam { type, file_id }
class BashCodeExecutionResultBlock { type, content, return_code, 2 more }
content: Array[BashCodeExecutionOutputBlock { type, file_id }]
class BashCodeExecutionResultBlockParam { type, content, return_code, 2 more }
content: Array[BashCodeExecutionOutputBlockParam { type, file_id }]
class BashCodeExecutionToolResultBlock { type, content, tool_use_id }
class BashCodeExecutionToolResultBlockParam { type, content, tool_use_id, cache_control }
class BashCodeExecutionToolResultError { type, error_code }
error_code: BashCodeExecutionToolResultErrorCode
BashCodeExecutionToolResultErrorCode = :invalid_tool_input | :unavailable | :too_many_requests | 2 more
class BashCodeExecutionToolResultErrorParam { type, error_code }
error_code: BashCodeExecutionToolResultErrorCode
class BrowserCloseTabConfig { defer_loading, enabled }close_tab's config overrides.
close_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserDoubleClickConfig { defer_loading, enabled }double_click's config overrides.
double_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserFileUploadConfig { defer_loading, enabled }file_upload's config overrides.
file_upload's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserFindConfig { defer_loading, enabled }find's config overrides.
find's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserFormInputConfig { defer_loading, enabled }form_input's config overrides.
form_input's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserGetPageTextConfig { defer_loading, enabled }get_page_text's config overrides.
get_page_text's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserHoldKeyConfig { defer_loading, enabled }hold_key's config overrides.
hold_key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserHoverConfig { defer_loading, enabled }hover's config overrides.
hover's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserJavascriptExecConfig { defer_loading, enabled }javascript_exec's config overrides.
javascript_exec's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserKeyConfig { defer_loading, enabled }key's config overrides.
key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserLeftClickConfig { defer_loading, enabled }left_click's config overrides.
left_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserLeftClickDragConfig { defer_loading, enabled }left_click_drag's config overrides.
left_click_drag's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserLeftMouseDownConfig { defer_loading, enabled }left_mouse_down's config overrides.
left_mouse_down's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserLeftMouseUpConfig { defer_loading, enabled }left_mouse_up's config overrides.
left_mouse_up's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserListTabsConfig { defer_loading, enabled }list_tabs's config overrides.
list_tabs's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserMiddleClickConfig { defer_loading, enabled }middle_click's config overrides.
middle_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserMouseMoveConfig { defer_loading, enabled }mouse_move's config overrides.
mouse_move's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserNavigateConfig { defer_loading, enabled }navigate's config overrides.
navigate's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserNewTabConfig { defer_loading, enabled }new_tab's config overrides.
new_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserReadConsoleConfig { defer_loading, enabled }read_console's config overrides.
read_console's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserReadNetworkConfig { defer_loading, enabled }read_network's config overrides.
read_network's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserReadPageConfig { defer_loading, enabled }read_page's config overrides.
read_page's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserRightClickConfig { defer_loading, enabled }right_click's config overrides.
right_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserScreenshotConfig { defer_loading, enabled }screenshot's config overrides.
screenshot's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserScrollConfig { defer_loading, enabled }scroll's config overrides.
scroll's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserScrollToConfig { defer_loading, enabled }scroll_to's config overrides.
scroll_to's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserStateBlockParam { type, tabs, cache_control, state_changes }The caller's browser state after a browser toolset member call —
the full inventory of open tabs, which tab is active, and any side
effects (tabs opened, download state changes) the call produced.
The caller's browser state after a browser toolset member call — the full inventory of open tabs, which tab is active, and any side effects (tabs opened, download state changes) the call produced.
At most one per tool_result, only on a non-error result answering a
browser toolset member tool_use. The server renders the
model-visible text from it; the model never sees the raw fields.
BrowserStateChange = BrowserStateChangeTabOpened { type, tab_id } | BrowserStateChangeDownloadStarted { type, download_id, url } | BrowserStateChangeDownloadCompleted { type, download_id, url, 2 more } | BrowserStateChangeDownloadFailed { type, download_id, url, error }
class BrowserStateChangeDownloadCompleted { type, download_id, url, 2 more }A file download that finished during this call, reported with the
same download_id as its download_started — or without a prior
download_started, when the download finished during the call that
started it (at most one state change per download_id per result).
A file download that finished during this call, reported with the
same download_id as its download_started — or without a prior
download_started, when the download finished during the call that
started it (at most one state change per download_id per result).
download_id: StringThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
url: StringThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
path: StringWhere the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
size_bytes: IntegerThe completed download's size.
The completed download's size.
class BrowserStateChangeDownloadFailed { type, download_id, url, error }A file download that failed — or was cancelled — during this call.
A file download that failed — or was cancelled — during this call.
download_id: StringThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
url: StringThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
error: StringThe failure or cancellation detail, when known.
The failure or cancellation detail, when known.
class BrowserStateChangeDownloadStarted { type, download_id, url }A file download that started during this call.
A file download that started during this call.
download_id: StringThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
url: StringThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
class BrowserStateChangeTabOpened { type, tab_id }A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
Carries only the tab_id; the tab's title and url live on its
tabs entry, which must include the same tab_id. A tab opened
during a failed call gets no deferred tab_opened; it simply appears
in the next result's tabs inventory.
tab_id: StringThe tab_id of the opened tab, present in tabs.
The tab_id of the opened tab, present in tabs.
class BrowserStateTabEntry { tab_id, title, url, active }One open browser tab reported in a browser_state block's tabs
inventory.
One open browser tab reported in a browser_state block's tabs
inventory.
tab_id is the caller-assigned identifier for the tab; title and
url describe the page the tab is currently showing and may be empty
strings (a blank tab legitimately has both empty). active marks the
tab that is active after this call; whenever tabs is non-empty,
exactly one entry is marked.
tab_id: StringThe caller-assigned identifier for this tab, unique within the inventory.
The caller-assigned identifier for this tab, unique within the inventory.
title: StringThe title of the page the tab is showing. May be empty.
The title of the page the tab is showing. May be empty.
url: StringThe URL of the page the tab is showing. May be empty.
The URL of the page the tab is showing. May be empty.
Whether this tab is the active tab after this call. Whenever tabs is non-empty, exactly one entry is marked active: true.
class BrowserSwitchTabConfig { defer_loading, enabled }switch_tab's config overrides.
switch_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserToolset20260801 { type, cache_control, configs }The browser toolset: a single tools[] entry (carrying no
name) that declares the browser tool family. The model is served
the family's tool with any members disabled via configs removed
from its schema.
The browser toolset: a single tools[] entry (carrying no
name) that declares the browser tool family. The model is served
the family's tool with any members disabled via configs removed
from its schema.
class BrowserToolsetConfigs { type, close_tab, double_click, 28 more }Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
class BrowserTripleClickConfig { defer_loading, enabled }triple_click's config overrides.
triple_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserTypeConfig { defer_loading, enabled }type's config overrides.
type's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserWaitConfig { defer_loading, enabled }wait's config overrides.
wait's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BrowserZoomConfig { defer_loading, enabled }zoom's config overrides.
zoom's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class CacheControlEphemeral { type, ttl }
ttl: :"5m" | :"1h"The time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
class CacheCreation { ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }
ephemeral_1h_input_tokens: IntegerThe number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 1 hour cache entry.
ephemeral_5m_input_tokens: IntegerThe number of input tokens used to create the 5 minute cache entry.
The number of input tokens used to create the 5 minute cache entry.
class CitationCharLocation { type, cited_text, document_index, 4 more }
document_index: Integer
start_char_index: Integer
class CitationCharLocationParam { type, cited_text, document_index, 3 more }
document_index: Integer
document_title: String
start_char_index: Integer
class CitationContentBlockLocation { type, cited_text, document_index, 4 more }
cited_text: StringThe full text of the cited block range, concatenated.
The full text of the cited block range, concatenated.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
document_index: Integer
end_block_index: IntegerExclusive 0-based end index of the cited block range in the source's content array.
Exclusive 0-based end index of the cited block range in the source's content array.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
start_block_index: Integer0-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
class CitationContentBlockLocationParam { type, cited_text, document_index, 3 more }
cited_text: StringThe full text of the cited block range, concatenated.
The full text of the cited block range, concatenated.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
document_index: Integer
document_title: String
end_block_index: IntegerExclusive 0-based end index of the cited block range in the source's content array.
Exclusive 0-based end index of the cited block range in the source's content array.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
start_block_index: Integer0-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
class CitationPageLocation { type, cited_text, document_index, 4 more }
document_index: Integer
start_page_number: Integer
class CitationPageLocationParam { type, cited_text, document_index, 3 more }
document_index: Integer
document_title: String
start_page_number: Integer
class CitationSearchResultLocationParam { type, cited_text, end_block_index, 4 more }
cited_text: StringThe full text of the cited block range, concatenated.
The full text of the cited block range, concatenated.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
end_block_index: IntegerExclusive 0-based end index of the cited block range in the source's content array.
Exclusive 0-based end index of the cited block range in the source's content array.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
search_result_index: Integer0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.
0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.
Counted separately from document_index; server-side web search results are not included in this count.
start_block_index: Integer0-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
class CitationWebSearchResultLocationParam { type, cited_text, encrypted_index, 2 more }
title: String
url: String
class CitationsConfig { enabled }
class CitationsConfigParam { enabled }
class CitationsDelta { type, citation }
class CitationsSearchResultLocation { type, cited_text, end_block_index, 4 more }
cited_text: StringThe full text of the cited block range, concatenated.
The full text of the cited block range, concatenated.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
end_block_index: IntegerExclusive 0-based end index of the cited block range in the source's content array.
Exclusive 0-based end index of the cited block range in the source's content array.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
search_result_index: Integer0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.
0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.
Counted separately from document_index; server-side web search results are not included in this count.
start_block_index: Integer0-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
class CitationsWebSearchResultLocation { type, cited_text, encrypted_index, 2 more }
title: String
class CodeExecutionOutputBlock { type, file_id }
class CodeExecutionOutputBlockParam { type, file_id }
class CodeExecutionResultBlock { type, content, return_code, 2 more }
content: Array[CodeExecutionOutputBlock { type, file_id }]
class CodeExecutionResultBlockParam { type, content, return_code, 2 more }
content: Array[CodeExecutionOutputBlockParam { type, file_id }]
class CodeExecutionTool20250522 { type, name, allowed_callers, 3 more }
class CodeExecutionTool20250825 { type, name, allowed_callers, 3 more }
class CodeExecutionTool20260120 { type, name, 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).
class CodeExecutionTool20260521 { type, name, allowed_callers, 3 more }Code execution tool with REPL state persistence.
Code execution tool with REPL state persistence.
class CodeExecutionToolResultBlock { type, content, tool_use_id }
content: CodeExecutionToolResultBlockContent
tool_use_id: String
CodeExecutionToolResultBlockContent = CodeExecutionToolResultError { type, error_code } | CodeExecutionResultBlock { type, content, return_code, 2 more } | EncryptedCodeExecutionResultBlock { type, content, encrypted_stdout, 2 more }
class CodeExecutionToolResultBlockParam { type, content, tool_use_id, cache_control }
tool_use_id: String
cache_control: CacheControlEphemeral { type, ttl }Create 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. See prompt caching pricing for details.
CodeExecutionToolResultBlockParamContent = CodeExecutionToolResultErrorParam { type, error_code } | CodeExecutionResultBlockParam { type, content, return_code, 2 more } | EncryptedCodeExecutionResultBlockParam { type, content, encrypted_stdout, 2 more }
class CodeExecutionToolResultError { type, error_code }
error_code: CodeExecutionToolResultErrorCode
CodeExecutionToolResultErrorCode = :invalid_tool_input | :unavailable | :too_many_requests | :execution_time_exceeded
class CodeExecutionToolResultErrorParam { type, error_code }
error_code: CodeExecutionToolResultErrorCode
class ComputerCursorPositionConfig { defer_loading, enabled }cursor_position's config overrides.
cursor_position's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerDoubleClickConfig { defer_loading, enabled }double_click's config overrides.
double_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerHoldKeyConfig { defer_loading, enabled }hold_key's config overrides.
hold_key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerKeyConfig { defer_loading, enabled }key's config overrides.
key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerLeftClickConfig { defer_loading, enabled }left_click's config overrides.
left_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerLeftClickDragConfig { defer_loading, enabled }left_click_drag's config overrides.
left_click_drag's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerLeftMouseDownConfig { defer_loading, enabled }left_mouse_down's config overrides.
left_mouse_down's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerLeftMouseUpConfig { defer_loading, enabled }left_mouse_up's config overrides.
left_mouse_up's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerMiddleClickConfig { defer_loading, enabled }middle_click's config overrides.
middle_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerMouseMoveConfig { defer_loading, enabled }mouse_move's config overrides.
mouse_move's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerRightClickConfig { defer_loading, enabled }right_click's config overrides.
right_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerScreenshotConfig { defer_loading, enabled }screenshot's config overrides.
screenshot's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerScrollConfig { defer_loading, enabled }scroll's config overrides.
scroll's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerToolset20260801 { type, cache_control, configs }The computer toolset: a single tools[] entry (carrying no
name) that declares the computer tool family. The model is
served the family's tool with any members disabled via configs
removed from its schema. Every member is enabled by default, zoom
included. The single-tool options display_number and
enable_zoom are not fields of a toolset entry — it carries only
type, configs, and cache_control; zoom is controlled
via configs.zoom.enabled.
The computer toolset: a single tools[] entry (carrying no
name) that declares the computer tool family. The model is
served the family's tool with any members disabled via configs
removed from its schema. Every member is enabled by default, zoom
included. The single-tool options display_number and
enable_zoom are not fields of a toolset entry — it carries only
type, configs, and cache_control; zoom is controlled
via configs.zoom.enabled.
class ComputerToolsetConfigs { type, cursor_position, double_click, 14 more }Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
class ComputerTripleClickConfig { defer_loading, enabled }triple_click's config overrides.
triple_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerTypeConfig { defer_loading, enabled }type's config overrides.
type's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerWaitConfig { defer_loading, enabled }wait's config overrides.
wait's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class ComputerZoomConfig { defer_loading, enabled }zoom's config overrides.
zoom's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class Container { 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
expires_at: TimeThe time at which the container will expire.
The time at which the container will expire.
skills: Array[ContainerSkill { type, skill_id, version }]Skills loaded in the container
Skills loaded in the container
type: :anthropic | :customType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
skill_id: StringSkill ID
Skill ID
version: StringThe resolved version: a skill version ID for custom skills.
The resolved version: a skill version ID for custom skills.
class ContainerParams { id, skills }Container parameters with skills to be loaded.
Container parameters with skills to be loaded.
Container id
skills: Array[SkillParams { type, skill_id, version }]List of skills to load in the container
List of skills to load in the container
type: :anthropic | :customType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
skill_id: StringSkill ID
Skill ID
version: StringSkill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
class ContainerSkill { type, skill_id, version }A skill that was loaded in a container (response model).
A skill that was loaded in a container (response model).
type: :anthropic | :customType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
skill_id: StringSkill ID
Skill ID
version: StringThe resolved version: a skill version ID for custom skills.
The resolved version: a skill version ID for custom skills.
class ContainerUploadBlock { type, file_id }Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
class ContainerUploadBlockParam { type, file_id, cache_control }A content block that represents a file to be uploaded to the container
Files uploaded via this block will be available in the container's input directory.
A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory.
cache_control: CacheControlEphemeral { type, ttl }Create 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. See prompt caching pricing for details.
ContentBlock = TextBlock { type, citations, text } | ThinkingBlock { type, signature, thinking } | RedactedThinkingBlock { type, data } | 9 more
ContentBlockParam = TextBlockParam { type, text, cache_control, citations } | ImageBlockParam { type, source, cache_control, transformations } | DocumentBlockParam { type, source, cache_control, 3 more } | 13 more
class ContentBlockSource { type, content }
content: String | Array[ContentBlockSourceContent]
ContentBlockSourceContent = Array[ContentBlockSourceContent]
class TextBlockParam { type, text, cache_control, citations }
class ImageBlockParam { type, source, cache_control, transformations }
ContentBlockSourceContent = TextBlockParam { type, text, cache_control, citations } | ImageBlockParam { type, source, cache_control, transformations }
class TextBlockParam { type, text, cache_control, citations }
class ImageBlockParam { type, source, cache_control, transformations }
class DirectCaller { type }Tool invocation directly from the model.
Tool invocation directly from the model.
class DocumentBlock { type, citations, source, title }
class DocumentBlockParam { type, source, cache_control, 3 more }
class EncryptedCodeExecutionResultBlock { type, content, encrypted_stdout, 2 more }Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array[CodeExecutionOutputBlock { type, file_id }]
class EncryptedCodeExecutionResultBlockParam { type, content, encrypted_stdout, 2 more }Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
content: Array[CodeExecutionOutputBlockParam { type, file_id }]
class FileDocumentSource { type, file_id }
class FileImageSource { type, file_id }
class ImageBlockParam { type, source, cache_control, transformations }
class ImageTransformationsParam { oversized_image }Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
oversized_image: :downsize | :errorWhat the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
What the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
class InputJSONDelta { type, partial_json }
class JSONOutputFormat { type, schema }
The JSON schema of the format
class MemoryTool20250818 { type, name, allowed_callers, 4 more }
class Message { type, id, container, 7 more }
MessageCountTokensTool = Tool { type, input_schema, name, 7 more } | ToolBash20250124 { type, name, allowed_callers, 4 more } | CodeExecutionTool20250522 { type, name, allowed_callers, 3 more } | 18 more
MessageCreateParamsContainer = ContainerParams { id, skills } | StringContainer identifier for reuse across requests.
Container identifier for reuse across requests.
class ContainerParams { id, skills }Container parameters with skills to be loaded.
Container parameters with skills to be loaded.
Container id
skills: Array[SkillParams { type, skill_id, version }]List of skills to load in the container
List of skills to load in the container
type: :anthropic | :customType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
skill_id: StringSkill ID
Skill ID
version: StringSkill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
class MessageDeltaUsage { cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 3 more }
class MessageParam { content, role }
class MessageTokensCount { input_tokens }
The total number of tokens across the provided list of messages, system prompt, and tools.
class Metadata { user_id }
user_id: StringAn external identifier for the user who is associated with the request.
An external identifier for the user who is associated with the request.
This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
Model = :"claude-fable-5-1" | :"claude-mythos-5-1" | :"claude-sonnet-5" | 14 more | StringThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
class OutputConfig { effort, format_ }
effort: :low | :medium | :high | 2 moreAll possible effort levels.
All possible effort levels.
format_: JSONOutputFormat { type, schema }A 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 OutputTokensDetails { thinking_tokens }
thinking_tokens: IntegerNumber of output tokens the model generated as internal reasoning, including
the thinking-block delimiter tokens.
Number of output tokens the model generated as internal reasoning, including the thinking-block delimiter tokens.
Reflects the raw reasoning the model produced, not the (possibly shorter)
summarized thinking text returned in the response body. Computed by
re-tokenizing the raw reasoning text, so it may differ from the model's exact
generation count by a small number of tokens. Always ≤ output_tokens;
output_tokens - thinking_tokens approximates the non-reasoning output.
class PlainTextSource { type, data, media_type }
RawContentBlockDelta = TextDelta { type, text } | InputJSONDelta { type, partial_json } | CitationsDelta { type, citation } | 2 more
class RawContentBlockDeltaEvent { type, delta, index }
class RawContentBlockStartEvent { type, content_block, index }
class RawContentBlockStopEvent { type, index }
class RawMessageDeltaEvent { type, delta, usage }
class RawMessageStartEvent { type, message }
message: Message { type, id, container, 7 more }
class RawMessageStopEvent { type }
RawMessageStreamEvent = RawMessageStartEvent { type, message } | RawMessageDeltaEvent { type, delta, usage } | RawMessageStopEvent { type } | 3 more
class RedactedThinkingBlock { type, data }
data: StringThe contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.
The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.
Pass redacted_thinking blocks back to the API unchanged when continuing a multi-turn conversation.
See extended thinking for details.
class RedactedThinkingBlockParam { type, data }
The data value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.
class RefusalStopDetails { type, category, explanation }Structured information about a refusal.
Structured information about a refusal.
category: :cyber | :bio | :frontier_llm | 2 moreThe policy category that triggered a refusal.
The policy category that triggered a refusal.
The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.
The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.
The request could assist the development of competing AI models, which is restricted under Anthropic's commercial terms. Benign machine learning work can also trigger this category.
The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use adaptive thinking.
The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
explanation: StringHuman-readable explanation of the refusal.
Human-readable explanation of the refusal.
This text is not guaranteed to be stable. null when no explanation is available for the category.
class SearchResultBlockParam { type, content, source, 3 more }
class ServerToolCaller { type, tool_id }Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
tool_id: String
class ServerToolCaller20260120 { type, tool_id }
tool_id: String
class ServerToolUsage { web_fetch_requests, web_search_requests }
web_fetch_requests: IntegerThe number of web fetch tool requests.
The number of web fetch tool requests.
web_search_requests: IntegerThe number of web search tool requests.
The number of web search tool requests.
class ServerToolUseBlock { type, id, caller_, 2 more }
class ServerToolUseBlockParam { type, id, input, 3 more }
class SignatureDelta { type, signature }
The signature for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a signature_delta event just before the block's content_block_stop event.
class SkillParams { type, skill_id, version }Specification for a skill to be loaded in a container (request model).
Specification for a skill to be loaded in a container (request model).
type: :anthropic | :customType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
skill_id: StringSkill ID
Skill ID
version: StringSkill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
StopReason = :end_turn | :max_tokens | :stop_sequence | 4 more
class TextBlock { type, citations, text }
class TextBlockParam { type, text, cache_control, citations }
TextCitation = CitationCharLocation { type, cited_text, document_index, 4 more } | CitationPageLocation { type, cited_text, document_index, 4 more } | CitationContentBlockLocation { type, cited_text, document_index, 4 more } | 2 more
TextCitationParam = CitationCharLocationParam { type, cited_text, document_index, 3 more } | CitationPageLocationParam { type, cited_text, document_index, 3 more } | CitationContentBlockLocationParam { type, cited_text, document_index, 3 more } | 2 more
class TextDelta { type, text }
class TextEditorCodeExecutionCreateResultBlock { type, is_file_update }
class TextEditorCodeExecutionCreateResultBlockParam { type, is_file_update }
class TextEditorCodeExecutionStrReplaceResultBlock { type, lines, new_lines, 3 more }
class TextEditorCodeExecutionStrReplaceResultBlockParam { type, lines, new_lines, 3 more }
class TextEditorCodeExecutionToolResultBlock { type, content, tool_use_id }
class TextEditorCodeExecutionToolResultBlockParam { type, content, tool_use_id, cache_control }
class TextEditorCodeExecutionToolResultError { type, error_code, error_message }
error_code: TextEditorCodeExecutionToolResultErrorCode
TextEditorCodeExecutionToolResultErrorCode = :invalid_tool_input | :unavailable | :too_many_requests | 2 more
class TextEditorCodeExecutionToolResultErrorParam { type, error_code, error_message }
error_code: TextEditorCodeExecutionToolResultErrorCode
class TextEditorCodeExecutionViewResultBlock { type, content, file_type, 3 more }
file_type: :text | :image | :pdf
class TextEditorCodeExecutionViewResultBlockParam { type, content, file_type, 3 more }
file_type: :text | :image | :pdf
class ThinkingBlock { type, signature, thinking }
signature: StringA value used to verify that this thinking block was generated by Claude when it is passed back to the API.
A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.
See extended thinking for details.
The text of Claude's thinking process for this block.
class ThinkingBlockParam { type, signature, thinking }
signature: StringThe signature value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
The signature value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 invalid_request_error.
The thinking text of this block as returned by the API.
class ThinkingConfigAdaptive { type, display_ }
display_: :summarized | :omittedControls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to summarized.
Controls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to summarized.
class ThinkingConfigDisabled { type }
class ThinkingConfigEnabled { type, budget_tokens, display_ }
budget_tokens: IntegerDetermines 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.
display_: :summarized | :omittedControls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to summarized.
Controls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to summarized.
ThinkingConfigParam = ThinkingConfigEnabled { type, budget_tokens, display_ } | ThinkingConfigDisabled { type } | ThinkingConfigAdaptive { type, display_ }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 ThinkingDelta { type, thinking }
The incremental thinking text for this content block. Concatenate the thinking values of successive thinking_delta events to assemble the block's full thinking value.
class Tool { type, input_schema, name, 7 more }
class ToolBash20250124 { type, name, allowed_callers, 4 more }
ToolChoice = ToolChoiceAuto { type, disable_parallel_tool_use } | ToolChoiceAny { type, disable_parallel_tool_use } | ToolChoiceTool { type, name, disable_parallel_tool_use } | ToolChoiceNone { type }How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
class ToolChoiceAny { type, disable_parallel_tool_use }The model will use any available tools.
The model will use any available tools.
disable_parallel_tool_use: boolWhether 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 { type, disable_parallel_tool_use }The model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
disable_parallel_tool_use: boolWhether 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 { type }The model will not be allowed to use tools.
The model will not be allowed to use tools.
class ToolChoiceTool { type, name, disable_parallel_tool_use }The model will use the specified tool with tool_choice.name.
The model will use the specified tool with tool_choice.name.
The name of the tool to use.
disable_parallel_tool_use: boolWhether 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 { type, tool_name }
tool_name: String
class ToolReferenceBlockParam { type, tool_name, cache_control }Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
tool_name: String
cache_control: CacheControlEphemeral { type, ttl }Create 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. See prompt caching pricing for details.
class ToolResultBlockParam { type, tool_use_id, cache_control, 3 more }
class ToolSearchToolBm25_20251119 { type, name, allowed_callers, 3 more }
class ToolSearchToolRegex20251119 { type, name, allowed_callers, 3 more }
class ToolSearchToolResultBlock { type, content, tool_use_id }
class ToolSearchToolResultBlockParam { type, content, tool_use_id, cache_control }
class ToolSearchToolResultError { type, error_code, error_message }
error_code: ToolSearchToolResultErrorCode
ToolSearchToolResultErrorCode = :invalid_tool_input | :unavailable | :too_many_requests | :execution_time_exceeded
class ToolSearchToolResultErrorParam { type, error_code, error_message }
error_code: ToolSearchToolResultErrorCode
class ToolSearchToolSearchResultBlock { type, tool_references }
tool_references: Array[ToolReferenceBlock { type, tool_name }]
tool_name: String
class ToolSearchToolSearchResultBlockParam { type, tool_references }
tool_references: Array[ToolReferenceBlockParam { type, tool_name, cache_control }]
tool_name: String
cache_control: CacheControlEphemeral { type, ttl }Create 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. See prompt caching pricing for details.
class ToolTextEditor20250124 { type, name, allowed_callers, 4 more }
class ToolTextEditor20250429 { type, name, allowed_callers, 4 more }
class ToolTextEditor20250728 { type, name, allowed_callers, 5 more }
ToolUnion = Tool { type, input_schema, name, 7 more } | ToolBash20250124 { type, name, allowed_callers, 4 more } | CodeExecutionTool20250522 { type, name, allowed_callers, 3 more } | 18 more
class ToolUseBlock { type, id, caller_, 3 more }
class ToolUseBlockParam { type, id, input, 4 more }
class URLImageSource { type, url }
class URLPDFSource { type, url }
class Usage { cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 6 more }
class UserLocation { type, city, country, 2 more }
city: StringThe city of the user.
The city of the user.
country: StringThe two letter ISO country code of the user.
The two letter ISO country code of the user.
region: StringThe region of the user.
The region of the user.
timezone: StringThe IANA timezone of the user.
The IANA timezone of the user.
class WebFetchBlock { type, content, retrieved_at, url }
content: DocumentBlock { type, citations, source, title }
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class WebFetchBlockParam { type, content, url, retrieved_at }
content: DocumentBlockParam { type, source, cache_control, 3 more }
Fetched content URL
ISO 8601 timestamp when the content was retrieved
class WebFetchTool20250910 { type, name, allowed_callers, 8 more }
class WebFetchTool20260209 { type, name, allowed_callers, 8 more }
class WebFetchTool20260309 { type, name, allowed_callers, 9 more }Web fetch tool with use_cache parameter for bypassing cached content.
Web fetch tool with use_cache parameter for bypassing cached content.
class WebFetchTool20260318 { type, name, allowed_callers, 10 more }
class WebFetchToolResultBlock { type, caller_, content, tool_use_id }
class WebFetchToolResultBlockParam { type, content, tool_use_id, 2 more }
class WebFetchToolResultErrorBlock { type, error_code }
error_code: WebFetchToolResultErrorCode
class WebFetchToolResultErrorBlockParam { type, error_code }
error_code: WebFetchToolResultErrorCode
WebFetchToolResultErrorCode = :invalid_tool_input | :url_too_long | :url_not_allowed | 7 more
class WebSearchResultBlock { type, encrypted_content, page_age, 2 more }
class WebSearchResultBlockParam { type, encrypted_content, title, 2 more }
class WebSearchTool20250305 { type, name, allowed_callers, 7 more }
class WebSearchTool20260209 { type, name, allowed_callers, 7 more }
class WebSearchTool20260318 { type, name, allowed_callers, 8 more }
class WebSearchToolRequestError { type, error_code }
error_code: WebSearchToolResultErrorCode
class WebSearchToolResultBlock { type, caller_, content, tool_use_id }
WebSearchToolResultBlockContent = WebSearchToolResultError { type, error_code } | Array[WebSearchResultBlock { type, encrypted_content, page_age, 2 more }]
class WebSearchToolResultBlockParam { type, content, tool_use_id, 2 more }
WebSearchToolResultBlockParamContent = Array[WebSearchResultBlockParam { type, encrypted_content, title, 2 more }] | WebSearchToolRequestError { type, error_code }
class WebSearchToolResultError { type, error_code }
error_code: WebSearchToolResultErrorCode
WebSearchToolResultErrorCode = :invalid_tool_input | :unavailable | :max_uses_exceeded | 3 more
MessagesBatches
Create a Message Batch
messages.batches.create(**kwargs) -> MessageBatchSend a batch of Message creation requests.
Retrieve a Message Batch
messages.batches.retrieve(message_batch_id, **kwargs) -> MessageBatchThis endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the results_url field in the response.
List Message Batches
messages.batches.list(**kwargs) -> Page<MessageBatch>List all Message Batches within a Workspace. Most recently created batches are returned first.
Cancel a Message Batch
messages.batches.cancel(message_batch_id, **kwargs) -> MessageBatchBatches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a canceling state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
Delete a Message Batch
messages.batches.delete(message_batch_id, **kwargs) -> DeletedMessageBatchRetrieve Message Batch results
messages.batches.results(message_batch_id, **kwargs) -> MessageBatchIndividualResponseStreams the results of a Message Batch as a .jsonl file.