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 AssistantMessageParam: content; role
content: MessageContentParam
class AvailableToolsLimitExceededErrorDetails: error_code
class Base64ImageSourceParam: type: "base64"; data; media_type
data: Union[str, Base64FileInput]
media_type: Literal["image/jpeg", "image/png", "image/gif", "image/webp"]
class Base64PDFSource: type: "base64"; data; media_type
data: str
class BashCodeExecutionOutputBlock: type: "bash_code_execution_output"; file_id
type: Literal["bash_code_execution_output"]
class BashCodeExecutionOutputBlockParam: type: "bash_code_execution_output"; file_id
class BashCodeExecutionResultBlock: type: "bash_code_execution_result"; content; return_code; ... # 2 more
type: Literal["bash_code_execution_result"]
content: List[BashCodeExecutionOutputBlock]
type: Literal["bash_code_execution_output"]
class BashCodeExecutionResultBlockParam: type: "bash_code_execution_result"; content; return_code; ... # 2 more
content: Iterable[BashCodeExecutionOutputBlockParam]
class BashCodeExecutionToolResultBlock: type: "bash_code_execution_tool_result"; content; tool_use_id
class BashCodeExecutionToolResultBlockParam: type: "bash_code_execution_tool_result"; content; tool_use_id; cache_control
class BashCodeExecutionToolResultError: type: "bash_code_execution_tool_result_error"; error_code
type: Literal["bash_code_execution_tool_result_error"]
error_code: BashCodeExecutionToolResultErrorCode
type BashCodeExecutionToolResultErrorCode = Literal["invalid_tool_input", "unavailable", "too_many_requests", 2 more]
class BashCodeExecutionToolResultErrorParam: type: "bash_code_execution_tool_result_error"; error_code
error_code: BashCodeExecutionToolResultErrorCode
type BrowserClickTarget = ...Where to act: either a viewport coordinate or an element reference.
Where to act: either a viewport coordinate or an element reference.
class BrowserCoordinateTarget: type: "coordinate"; x; yA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
x: intPixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
y: intPixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
class BrowserRefTarget: type: "ref"; refAn element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
class BrowserCloseTabConfigParam: defer_loading; enabledclose_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 BrowserCloseTabInput: tab_idClose the tab with the given tab_id.
Close the tab with the given tab_id.
The tab to close.
class BrowserCloseTabToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserCoordinateTarget: type: "coordinate"; x; yA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
x: intPixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
y: intPixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
class BrowserDoubleClickConfigParam: defer_loading; enableddouble_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 BrowserDoubleClickInput: target; modifiers; tab_idDouble left-click at a viewport coordinate or on an element by reference.
Double left-click at a viewport coordinate or on an element by reference.
class BrowserDoubleClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserFileUploadConfigParam: defer_loading; enabledfile_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 BrowserFileUploadInput: target; document_ids; paths; tab_idSet the value of a file-input element to one or more files. The target must be an
element reference; at least one of paths or document_ids is required.
Set the value of a file-input element to one or more files. The target must be an element reference; at least one of paths or document_ids is required.
target: BrowserRefTargetAn element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
document_ids: Optional[List[str]]References to files the harness has staged, for deployments where the browser executor cannot read the caller's filesystem.
References to files the harness has staged, for deployments where the browser executor cannot read the caller's filesystem.
paths: Optional[List[str]]File paths on the browser executor's filesystem.
File paths on the browser executor's filesystem.
Tab to act on. Defaults to the active tab when omitted.
class BrowserFileUploadToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserFindConfigParam: defer_loading; enabledfind'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 BrowserFindInput: query; tab_idFind elements matching a natural-language description (e.g. "search bar", "add to
cart button") and return up to 20 matches with element references.
Find elements matching a natural-language description (e.g. "search bar", "add to cart button") and return up to 20 matches with element references.
Natural-language description of the element(s) to find.
Tab to act on. Defaults to the active tab when omitted.
class BrowserFindToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserFormInputConfigParam: defer_loading; enabledform_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 BrowserFormInputInput: target; value; tab_idSet the value of a form element (input, textarea, select, checkbox). Use a
boolean for checkboxes, an option value or text for selects.
Set the value of a form element (input, textarea, select, checkbox). Use a boolean for checkboxes, an option value or text for selects.
target: BrowserRefTargetAn element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
value: BrowserFormInputValueThe value to set.
The value to set.
Tab to act on. Defaults to the active tab when omitted.
class BrowserFormInputToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
type BrowserFormInputValue = Union[str, float, bool]
class BrowserGetPageTextConfigParam: defer_loading; enabledget_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 BrowserGetPageTextInput: tab_idReturn the page's visible text content as plain text, prioritizing article
content. Suited to articles, documentation, and other text-heavy pages.
Return the page's visible text content as plain text, prioritizing article content. Suited to articles, documentation, and other text-heavy pages.
Tab to act on. Defaults to the active tab when omitted.
class BrowserGetPageTextToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserHoldKeyConfigParam: defer_loading; enabledhold_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 BrowserHoldKeyInput: duration; text; tab_idHold a key or key chord down for a duration, then release it. Uses the same key
names and "+" chord syntax as the key action.
Hold a key or key chord down for a duration, then release it. Uses the same key names and "+" chord syntax as the key action.
duration: floatSeconds to hold the key down (maximum 30).
Seconds to hold the key down (maximum 30).
The key or chord to hold.
Tab to act on. Defaults to the active tab when omitted.
class BrowserHoldKeyToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserHoverConfigParam: defer_loading; enabledhover'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 BrowserHoverInput: target; tab_idMove the cursor to a coordinate or element without clicking.
Move the cursor to a coordinate or element without clicking.
class BrowserHoverToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserJavascriptExecConfigParam: defer_loading; enabledjavascript_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 BrowserJavascriptExecInput: text; tab_idExecute JavaScript in the page context and return the value of the last
expression. The code runs with access to the DOM, window, and page variables.
Write the expression you want evaluated — do NOT use return.
Execute JavaScript in the page context and return the value of the last
expression. The code runs with access to the DOM, window, and page variables.
Write the expression you want evaluated — do NOT use return.
JavaScript to execute in the page context.
Tab to act on. Defaults to the active tab when omitted.
class BrowserJavascriptExecToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserKeyConfigParam: defer_loading; enabledkey'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 BrowserKeyInput: text; repeat; tab_idPress a key or key chord. Use "+" to combine modifiers with a key (e.g. "ctrl+a",
"cmd+shift+p") and space to sequence presses (e.g. "Backspace Backspace Delete").
Common names like "Return", "Tab", "Escape", "BackSpace" are supported.
Press a key or key chord. Use "+" to combine modifiers with a key (e.g. "ctrl+a", "cmd+shift+p") and space to sequence presses (e.g. "Backspace Backspace Delete"). Common names like "Return", "Tab", "Escape", "BackSpace" are supported.
The key, chord, or space-separated sequence to press.
repeat: Optional[int]Number of times to repeat. Default 1.
Number of times to repeat. Default 1.
Tab to act on. Defaults to the active tab when omitted.
class BrowserKeyToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserLeftClickConfigParam: defer_loading; enabledleft_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 BrowserLeftClickDragConfigParam: defer_loading; enabledleft_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 BrowserLeftClickDragInput: from_; target; tab_idPress at from, drag to target, release. Both must be coordinate targets.
Press at from, drag to target, release. Both must be coordinate targets.
from_: BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
x: intPixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
y: intPixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
target: BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
x: intPixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
y: intPixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Tab to act on. Defaults to the active tab when omitted.
class BrowserLeftClickDragToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserLeftClickInput: target; modifiers; tab_idLeft-click at a viewport coordinate or on an element by reference.
Left-click at a viewport coordinate or on an element by reference.
class BrowserLeftClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserLeftMouseDownConfigParam: defer_loading; enabledleft_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 BrowserLeftMouseDownInput: target; tab_idPress and hold the left mouse button at a viewport coordinate. Pair with
left_mouse_up to perform a custom drag.
Press and hold the left mouse button at a viewport coordinate. Pair with left_mouse_up to perform a custom drag.
target: BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
x: intPixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
y: intPixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Tab to act on. Defaults to the active tab when omitted.
class BrowserLeftMouseDownToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserLeftMouseUpConfigParam: defer_loading; enabledleft_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 BrowserLeftMouseUpInput: target; tab_idRelease the left mouse button at a viewport coordinate.
Release the left mouse button at a viewport coordinate.
target: BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
x: intPixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
y: intPixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Tab to act on. Defaults to the active tab when omitted.
class BrowserLeftMouseUpToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserListTabsConfigParam: defer_loading; enabledlist_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.
List all open tabs with each tab's tab_id, title, and URL.
class BrowserListTabsToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserMiddleClickConfigParam: defer_loading; enabledmiddle_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 BrowserMiddleClickInput: target; modifiers; tab_idMiddle-click at a viewport coordinate or on an element by reference.
Middle-click at a viewport coordinate or on an element by reference.
class BrowserMiddleClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserMouseMoveConfigParam: defer_loading; enabledmouse_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 BrowserMouseMoveInput: target; tab_idMove the pointer to a viewport coordinate without clicking.
Move the pointer to a viewport coordinate without clicking.
target: BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
x: intPixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
y: intPixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Tab to act on. Defaults to the active tab when omitted.
class BrowserMouseMoveToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserNavigateConfigParam: defer_loading; enablednavigate'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 BrowserNavigateInput: url; tab_idNavigate to a URL, or go back/forward/reload in history. The protocol may be
omitted (defaults to https://).
Navigate to a URL, or go back/forward/reload in history. The protocol may be omitted (defaults to https://).
The URL to navigate to, or "back" / "forward" / "reload" for history navigation.
Tab to act on. Defaults to the active tab when omitted.
class BrowserNavigateToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserNewTabConfigParam: defer_loading; enablednew_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.
Open a new empty tab and return its tab_id.
class BrowserNewTabToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserReadConsoleConfigParam: defer_loading; enabledread_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 BrowserReadConsoleInput: tab_idReturn console output (log entries, errors, warnings) accumulated since the
driver attached to the tab and since the last read, one line per entry. An empty
result does not mean no traffic for a tab that predates attach.
Return console output (log entries, errors, warnings) accumulated since the driver attached to the tab and since the last read, one line per entry. An empty result does not mean no traffic for a tab that predates attach.
Tab to act on. Defaults to the active tab when omitted.
class BrowserReadConsoleToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserReadNetworkConfigParam: defer_loading; enabledread_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 BrowserReadNetworkInput: tab_idReturn the network requests (method, URL, status, MIME type, timing) recorded
since the driver attached to the tab and since the last read, one line per entry.
An empty result does not mean no traffic for a tab that predates attach.
Return the network requests (method, URL, status, MIME type, timing) recorded since the driver attached to the tab and since the last read, one line per entry. An empty result does not mean no traffic for a tab that predates attach.
Tab to act on. Defaults to the active tab when omitted.
class BrowserReadNetworkToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserReadPageConfigParam: defer_loading; enabledread_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.
type BrowserReadPageFilter = Literal["all", "interactive"]
class BrowserReadPageInput: depth; filter; ref; tab_idReturn a structured accessibility tree of the page (or the subtree rooted at
ref), with element references like [ref_7] that can be used as targets on later
actions. Output is capped at 50,000 characters — narrow with ref or a smaller
depth when exceeded.
Return a structured accessibility tree of the page (or the subtree rooted at
ref), with element references like [ref_7] that can be used as targets on later
actions. Output is capped at 50,000 characters — narrow with ref or a smaller
depth when exceeded.
depth: Optional[int]Maximum tree depth. Default 15.
Maximum tree depth. Default 15.
filter: Optional[BrowserReadPageFilter]Which elements to include. Omitted: every visible element. "interactive": interactive elements only. "all": additionally includes off-viewport elements.
Which elements to include. Omitted: every visible element. "interactive": interactive elements only. "all": additionally includes off-viewport elements.
Element reference to read a subtree from. Omit to read from the page root.
Tab to act on. Defaults to the active tab when omitted.
class BrowserReadPageToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserRefTarget: type: "ref"; refAn element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
class BrowserRightClickConfigParam: defer_loading; enabledright_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 BrowserRightClickInput: target; modifiers; tab_idRight-click at a viewport coordinate or on an element by reference.
Right-click at a viewport coordinate or on an element by reference.
class BrowserRightClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserScreenshotConfigParam: defer_loading; enabledscreenshot'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 BrowserScreenshotInput: tab_idCapture the current browser viewport.
Capture the current browser viewport.
Tab to act on. Defaults to the active tab when omitted.
class BrowserScreenshotToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserScrollConfigParam: defer_loading; enabledscroll'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.
type BrowserScrollDirection = Literal["up", "down", "left", "right"]
class BrowserScrollInput: scroll_direction; target; scroll_amount; tab_idScroll at a viewport position. target must be a coordinate target.
Scroll at a viewport position. target must be a coordinate target.
scroll_direction: BrowserScrollDirection
target: BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
x: intPixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
y: intPixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
scroll_amount: Optional[int]Scroll-wheel notches (1–10). Default 3.
Scroll-wheel notches (1–10). Default 3.
Tab to act on. Defaults to the active tab when omitted.
class BrowserScrollToConfigParam: defer_loading; enabledscroll_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 BrowserScrollToInput: target; tab_idScroll an element into view.
Scroll an element into view.
target: BrowserRefTargetAn element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
Tab to act on. Defaults to the active tab when omitted.
class BrowserScrollToToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserScrollToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserStateBlockParam: type: "browser_state"; tabs; cache_control; state_changesThe 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.
type BrowserStateChangeParam = ...
class BrowserStateChangeDownloadCompletedParam: type: "download_completed"; download_id; url; ... # 2 moreA 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: strThe 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: strThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
path: Optional[str]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.
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: Optional[int]The completed download's size.
The completed download's size.
class BrowserStateChangeDownloadFailedParam: type: "download_failed"; download_id; url; errorA file download that failed — or was cancelled — during this call.
A file download that failed — or was cancelled — during this call.
download_id: strThe 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: strThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
error: Optional[str]The failure or cancellation detail, when known.
The failure or cancellation detail, when known.
class BrowserStateChangeDownloadStartedParam: type: "download_started"; download_id; urlA file download that started during this call.
A file download that started during this call.
download_id: strThe 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: strThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
class BrowserStateChangeTabOpenedParam: type: "tab_opened"; tab_idA 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: strThe tab_id of the opened tab, present in tabs.
The tab_id of the opened tab, present in tabs.
class BrowserStateTabEntryParam: tab_id; title; url; activeOne 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: strThe caller-assigned identifier for this tab, unique within the inventory.
The caller-assigned identifier for this tab, unique within the inventory.
title: strThe title of the page the tab is showing. May be empty.
The title of the page the tab is showing. May be empty.
url: strThe 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 BrowserSwitchTabConfigParam: defer_loading; enabledswitch_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 BrowserSwitchTabInput: tab_idMake the tab with the given tab_id the active tab — the tab that actions without
a tab_id apply to.
Make the tab with the given tab_id the active tab — the tab that actions without a tab_id apply to.
The tab to switch to.
class BrowserSwitchTabToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
type BrowserToolUseBlock = ...
class BrowserToolset20260801Param: type: "browser_toolset_20260801"; cache_control; configsThe 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.
cache_control: Optional[CacheControlEphemeralParam]Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl: Optional[Literal["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.
configs: Optional[BrowserToolsetConfigsParam]Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
class BrowserToolsetConfigsParam: type; close_tab; double_click; ... # 28 morePer-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 BrowserTripleClickConfigParam: defer_loading; enabledtriple_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 BrowserTripleClickInput: target; modifiers; tab_idTriple left-click at a viewport coordinate or on an element by reference
(typically selects a line or paragraph).
Triple left-click at a viewport coordinate or on an element by reference (typically selects a line or paragraph).
class BrowserTripleClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserTypeConfigParam: defer_loading; enabledtype'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 BrowserTypeInput: text; tab_idType a literal string at the current focus.
Type a literal string at the current focus.
The text to type.
Tab to act on. Defaults to the active tab when omitted.
class BrowserTypeToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserWaitConfigParam: defer_loading; enabledwait'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 BrowserWaitInput: duration; tab_idPause for the given duration.
Pause for the given duration.
duration: floatSeconds to wait (maximum 30).
Seconds to wait (maximum 30).
Tab to act on. Defaults to the active tab when omitted.
class BrowserWaitToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class BrowserZoomConfigParam: defer_loading; enabledzoom'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 BrowserZoomInput: region; tab_idReturn a cropped screenshot of the given viewport region, scaled up for closer
inspection — useful for small icons, buttons, or text. Coordinates are in the
same viewport-pixel space as a full screenshot.
Return a cropped screenshot of the given viewport region, scaled up for closer inspection — useful for small icons, buttons, or text. Coordinates are in the same viewport-pixel space as a full screenshot.
region: List[int][x0, y0, x1, y1] in viewport pixels.
[x0, y0, x1, y1] in viewport pixels.
Tab to act on. Defaults to the active tab when omitted.
class BrowserZoomToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class CacheControlEphemeralParam: type: "ephemeral"; ttl
ttl: Optional[Literal["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: intThe 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: intThe 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 CacheMissMessagesChanged: type: "messages_changed"; cache_missed_input_tokensA cache_miss_reason for a request whose messages differ from the previous request's in an earlier entry, instead of only having entries appended. The model, system, and tools match.
A cache_miss_reason for a request whose messages differ from the previous request's in an earlier entry, instead of only having entries appended. The model, system, and tools match.
See the cache diagnostics guide to learn what to change for each reason.
type: Literal["messages_changed"]
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class CacheMissModelChanged: type: "model_changed"; cache_missed_input_tokensA cache_miss_reason for a request whose model or speed differs from the previous request's.
A cache_miss_reason for a request whose model or speed differs from the previous request's.
See the cache diagnostics guide to learn what to change for each reason.
type: Literal["model_changed"]
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class CacheMissPreviousMessageNotFound: type: "previous_message_not_found"A cache_miss_reason for when the API doesn't have a stored record of the request that diagnostics.previous_message_id references.
A cache_miss_reason for when the API doesn't have a stored record of the request that diagnostics.previous_message_id references.
This doesn't mean that this request changed.
See the cache diagnostics guide to learn what to change for each reason.
type: Literal["previous_message_not_found"]
type CacheMissReason = ...
class CacheMissSystemChanged: type: "system_changed"; cache_missed_input_tokensA cache_miss_reason for a request whose system differs from the previous request's.
A cache_miss_reason for a request whose system differs from the previous request's.
See the cache diagnostics guide to learn what to change for each reason.
type: Literal["system_changed"]
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class CacheMissToolsChanged: type: "tools_changed"; cache_missed_input_tokensA cache_miss_reason for a request whose tools differ from the previous request's, for example because tools were added, removed, or reordered.
A cache_miss_reason for a request whose tools differ from the previous request's, for example because tools were added, removed, or reordered.
See the cache diagnostics guide to learn what to change for each reason.
type: Literal["tools_changed"]
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class CacheMissUnavailable: type: "unavailable"A cache_miss_reason for when the API can't give a diagnosis. The request itself was processed normally.
A cache_miss_reason for when the API can't give a diagnosis. The request itself was processed normally.
This includes a request whose model, system, and tools match the previous request's but whose other prompt-affecting parameters, such as thinking or tool_choice, differ.
See the cache diagnostics guide to learn what to change for each reason.
type: Literal["unavailable"]
class CitationCharLocation: type: "char_location"; cited_text; document_index; ... # 4 more
type: Literal["char_location"]
document_index: int
start_char_index: int
class CitationCharLocationParam: type: "char_location"; cited_text; document_index; ... # 3 more
document_index: int
document_title: Optional[str]
start_char_index: int
class CitationContentBlockLocation: type: "content_block_location"; cited_text; document_index; ... # 4 more
type: Literal["content_block_location"]
cited_text: strThe 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: int
end_block_index: intExclusive 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: int0-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: "content_block_location"; cited_text; document_index; ... # 3 more
cited_text: strThe 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: int
document_title: Optional[str]
end_block_index: intExclusive 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: int0-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: "page_location"; cited_text; document_index; ... # 4 more
type: Literal["page_location"]
document_index: int
start_page_number: int
class CitationPageLocationParam: type: "page_location"; cited_text; document_index; ... # 3 more
document_index: int
document_title: Optional[str]
start_page_number: int
class CitationSearchResultLocationParam: type: "search_result_location"; cited_text; end_block_index; ... # 4 more
cited_text: strThe 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: intExclusive 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: int0-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: int0-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: "web_search_result_location"; cited_text; encrypted_index; ... # 2 more
title: Optional[str]
url: str
class CitationsConfig: enabled
enabled: bool
class CitationsConfigParam: enabled
class CitationsDelta: type: "citations_delta"; citation
class CitationsSearchResultLocation: type: "search_result_location"; cited_text; end_block_index; ... # 4 more
type: Literal["search_result_location"]
cited_text: strThe 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: intExclusive 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: int0-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: int0-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: "web_search_result_location"; cited_text; encrypted_index; ... # 2 more
type: Literal["web_search_result_location"]
title: Optional[str]
class CodeExecutionOutputBlock: type: "code_execution_output"; file_id
type: Literal["code_execution_output"]
class CodeExecutionOutputBlockParam: type: "code_execution_output"; file_id
class CodeExecutionResultBlock: type: "code_execution_result"; content; return_code; ... # 2 more
type: Literal["code_execution_result"]
content: List[CodeExecutionOutputBlock]
type: Literal["code_execution_output"]
class CodeExecutionResultBlockParam: type: "code_execution_result"; content; return_code; ... # 2 more
content: Iterable[CodeExecutionOutputBlockParam]
class CodeExecutionTool20250522Param: type: "code_execution_20250522"; name; allowed_callers; ... # 3 more
class CodeExecutionTool20250825Param: type: "code_execution_20250825"; name; allowed_callers; ... # 3 more
class CodeExecutionTool20260120Param: type: "code_execution_20260120"; name; allowed_callers; ... # 3 moreA tools entry for the code execution tool, version code_execution_20260120. It adds REPL state persistence to version code_execution_20250825.
A tools entry for the code execution tool, version code_execution_20260120. It adds REPL state persistence to version code_execution_20250825.
REPL state persistence applies with programmatic tool calling. With it, the Python interpreter state, such as variable bindings, persists across requests that reuse the container.
See the code execution tool guide to learn what each tool version adds.
class CodeExecutionTool20260521Param: type: "code_execution_20260521"; name; allowed_callers; ... # 3 moreCode execution tool with REPL state persistence.
Code execution tool with REPL state persistence.
class CodeExecutionToolResultBlock: type: "code_execution_tool_result"; content; tool_use_id
type: Literal["code_execution_tool_result"]
content: CodeExecutionToolResultBlockContent
tool_use_id: str
type CodeExecutionToolResultBlockContent = ...
class CodeExecutionToolResultBlockParam: type: "code_execution_tool_result"; content; tool_use_id; cache_control
tool_use_id: str
cache_control: Optional[CacheControlEphemeralParam]Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl: Optional[Literal["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.
type CodeExecutionToolResultBlockParamContentParam = ...
class CodeExecutionToolResultError: type: "code_execution_tool_result_error"; error_code
type: Literal["code_execution_tool_result_error"]
error_code: CodeExecutionToolResultErrorCode
type CodeExecutionToolResultErrorCode = Literal["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]
class CodeExecutionToolResultErrorParam: type: "code_execution_tool_result_error"; error_code
error_code: CodeExecutionToolResultErrorCode
class CompactionBlockAmbiguousErrorDetails: error_code
class CompactionBlockMisplacedErrorDetails: error_code
class CompactionContentMismatchErrorDetails: error_code
class CompactionIncompleteTurnErrorDetails: error_code
class CompactionNothingToSummarizeErrorDetails: error_code
class CompactionSignatureInvalidErrorDetails: error_code
class CompactionTooManyToolReferencesErrorDetails: error_code
class CompactionToolChangesMismatchErrorDetails: error_code
class CompactionUnavailableErrorDetails: error_code
class ComputerCursorPositionConfigParam: defer_loading; enabledcursor_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.
Get the current (x, y) pixel coordinate of the cursor.
class ComputerCursorPositionToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerDoubleClickConfigParam: defer_loading; enableddouble_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 ComputerDoubleClickInput: coordinate; textDouble-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
Double-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
coordinate: Optional[List[int]](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class ComputerDoubleClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerHoldKeyConfigParam: defer_loading; enabledhold_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 ComputerHoldKeyInput: duration; textHold down a key or key-combination for a specified duration. Uses the same key
syntax as key.
Hold down a key or key-combination for a specified duration. Uses the same key
syntax as key.
duration: intDuration to hold the key, in seconds.
Duration to hold the key, in seconds.
The key or key-combination to hold.
class ComputerHoldKeyToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerKeyConfigParam: defer_loading; enabledkey'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 ComputerKeyInput: text; repeatPress a key or key-combination on the keyboard. Use "+" to combine modifiers with
a key (e.g. "ctrl+s", "alt+Tab", "ctrl+shift+Escape"). Key names are
case-insensitive; common names like "Return", "Tab", "Escape", "Up", "Down",
"Left", "Right", "Home", "End", "Page_Up", "Page_Down", "Delete", "BackSpace" are
supported.
Press a key or key-combination on the keyboard. Use "+" to combine modifiers with a key (e.g. "ctrl+s", "alt+Tab", "ctrl+shift+Escape"). Key names are case-insensitive; common names like "Return", "Tab", "Escape", "Up", "Down", "Left", "Right", "Home", "End", "Page_Up", "Page_Down", "Delete", "BackSpace" are supported.
The key or key-combination to press.
repeat: Optional[int]Number of times to repeat the key press. Default is 1.
Number of times to repeat the key press. Default is 1.
class ComputerKeyToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerLeftClickConfigParam: defer_loading; enabledleft_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 ComputerLeftClickDragConfigParam: defer_loading; enabledleft_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 ComputerLeftClickDragInput: coordinate; start_coordinate; textClick and drag the cursor from start_coordinate to coordinate.
Click and drag the cursor from start_coordinate to coordinate.
coordinate: List[int](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
start_coordinate: List[int](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class ComputerLeftClickDragToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerLeftClickInput: coordinate; textClick the left mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Click the left mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
coordinate: Optional[List[int]](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class ComputerLeftClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerLeftMouseDownConfigParam: defer_loading; enabledleft_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.
Press and hold the left mouse button at the current cursor position.
class ComputerLeftMouseDownToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerLeftMouseUpConfigParam: defer_loading; enabledleft_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.
Release the left mouse button.
class ComputerLeftMouseUpToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerMiddleClickConfigParam: defer_loading; enabledmiddle_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 ComputerMiddleClickInput: coordinate; textClick the middle mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Click the middle mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
coordinate: Optional[List[int]](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class ComputerMiddleClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerMouseMoveConfigParam: defer_loading; enabledmouse_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 ComputerMouseMoveInput: coordinateMove the cursor to a specified (x, y) pixel coordinate. Use this ONLY to hover
without clicking; otherwise use a click action directly.
Move the cursor to a specified (x, y) pixel coordinate. Use this ONLY to hover without clicking; otherwise use a click action directly.
coordinate: List[int](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
class ComputerMouseMoveToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerRightClickConfigParam: defer_loading; enabledright_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 ComputerRightClickInput: coordinate; textClick the right mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Click the right mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
coordinate: Optional[List[int]](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class ComputerRightClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerScreenshotConfigParam: defer_loading; enabledscreenshot'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.
Take a screenshot of the screen.
class ComputerScreenshotToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerScrollConfigParam: defer_loading; enabledscroll'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.
type ComputerScrollDirection = Literal["up", "down", "left", "right"]
class ComputerScrollInput: scroll_amount; scroll_direction; coordinate; textScroll the screen at the specified (x, y) pixel coordinate, or the current cursor
position if coordinate is omitted. Do NOT use PageUp/PageDown to scroll.
Scroll the screen at the specified (x, y) pixel coordinate, or the current cursor
position if coordinate is omitted. Do NOT use PageUp/PageDown to scroll.
Number of 'clicks' of the scroll wheel.
scroll_direction: ComputerScrollDirection
coordinate: Optional[List[int]](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class ComputerScrollToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
type ComputerToolUseBlock = ...
class ComputerToolset20260801Param: type: "computer_toolset_20260801"; cache_control; configsThe 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.
cache_control: Optional[CacheControlEphemeralParam]Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl: Optional[Literal["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.
configs: Optional[ComputerToolsetConfigsParam]Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
class ComputerToolsetConfigsParam: type; cursor_position; double_click; ... # 14 morePer-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 ComputerTripleClickConfigParam: defer_loading; enabledtriple_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 ComputerTripleClickInput: coordinate; textTriple-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
Triple-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
coordinate: Optional[List[int]](x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class ComputerTripleClickToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerTypeConfigParam: defer_loading; enabledtype'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 ComputerTypeInput: textType a string of text on the keyboard.
Type a string of text on the keyboard.
The text to type.
class ComputerTypeToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerWaitConfigParam: defer_loading; enabledwait'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 ComputerWaitInput: durationWait for a specified duration.
Wait for a specified duration.
duration: intDuration to wait, in seconds.
Duration to wait, in seconds.
class ComputerWaitToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ComputerZoomConfigParam: defer_loading; enabledzoom'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 ComputerZoomInput: regionTake a screenshot of a rectangular region. Region coordinates are in the
full-screenshot space (not physical display pixels). The crop is scaled up to
fill the image budget so fine details become legible.
Take a screenshot of a rectangular region. Region coordinates are in the full-screenshot space (not physical display pixels). The crop is scaled up to fill the image budget so fine details become legible.
region: List[int](x0, y0, x1, y1): The region to capture.
(x0, y0, x1, y1): The region to capture.
class ComputerZoomToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class Container: id; expires_at; skillsInformation 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: datetimeThe time at which the container will expire.
The time at which the container will expire.
skills: Optional[List[ContainerSkill]]Skills loaded in the container
Skills loaded in the container
type: Literal["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_id: strSkill ID
Skill ID
version: strThe resolved version: a skill version ID for custom skills.
The resolved version: a skill version ID for custom skills.
class ContainerParams: id; skillsContainer parameters with skills to be loaded.
Container parameters with skills to be loaded.
Container id
skills: Optional[Iterable[SkillParams]]List of skills to load in the container
List of skills to load in the container
type: Literal["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_id: strSkill ID
Skill ID
version: Optional[str]Skill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
class ContainerSkill: type; skill_id; versionA skill that was loaded in a container (response model).
A skill that was loaded in a container (response model).
type: Literal["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_id: strSkill ID
Skill ID
version: strThe resolved version: a skill version ID for custom skills.
The resolved version: a skill version ID for custom skills.
class ContainerUploadBlock: type: "container_upload"; file_idResponse model for a file uploaded to the container.
Response model for a file uploaded to the container.
type: Literal["container_upload"]
class ContainerUploadBlockParam: type: "container_upload"; file_id; cache_controlA 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: Optional[CacheControlEphemeralParam]Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl: Optional[Literal["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.
type ContentBlock = ...
type ContentBlockParam = Union[TextBlockParam, ImageBlockParam, DocumentBlockParam, 13 more]
class ContentBlockSourceParam: type: "content"; content
content: Union[str, Iterable[ContentBlockSourceContentParam]]
Iterable[ContentBlockSourceContentParam]
class TextBlockParam: type: "text"; text; cache_control; citations
class ImageBlockParam: type: "image"; source; cache_control; transformations
type ContentBlockSourceContentParam = ...
class TextBlockParam: type: "text"; text; cache_control; citations
class ImageBlockParam: type: "image"; source; cache_control; transformations
class Diagnostics: cache_miss_reasonRequest-level diagnostics: why the prompt cache could not fully reuse
the prefix of the request named by diagnostics.previous_message_id.
Request-level diagnostics: why the prompt cache could not fully reuse
the prefix of the request named by diagnostics.previous_message_id.
cache_miss_reason: Optional[CacheMissReason]Explains why the prompt cache could not fully reuse the prefix from the request identified by diagnostics.previous_message_id. null means diagnosis is still pending — the response was serialized before the background comparison completed.
Explains why the prompt cache could not fully reuse the prefix from the request identified by diagnostics.previous_message_id. null means diagnosis is still pending — the response was serialized before the background comparison completed.
class DiagnosticsParam: previous_message_idRequest-level diagnostics. Currently carries the previous response
id for prompt-cache divergence reporting.
Request-level diagnostics. Currently carries the previous response id for prompt-cache divergence reporting.
previous_message_id: Optional[str]The id (msg_...) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns diagnostics.cache_miss_reason when the prompt-cache prefix could not be reused. Pass null on the first turn to opt in without a prior message to compare.
The id (msg_...) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns diagnostics.cache_miss_reason when the prompt-cache prefix could not be reused. Pass null on the first turn to opt in without a prior message to compare.
class DirectCaller: type: "direct"Tool invocation directly from the model.
Tool invocation directly from the model.
class DocumentBlock: type: "document"; citations; source; title
class DocumentBlockParam: type: "document"; source; cache_control; ... # 3 more
class EncryptedCodeExecutionResultBlock: type: "encrypted_code_execution_result"; content; encrypted_stdout; ... # 2 moreThe output and exit code of Python code that Claude ran with the code execution tool, with standard output in encrypted form.
The output and exit code of Python code that Claude ran with the code execution tool, with standard output in encrypted form.
The API returns this block in place of code_execution_result when the code called the web search tool.
See the programmatic tool calling guide to learn more about programmatic tool calling.
type: Literal["encrypted_code_execution_result"]
content: List[CodeExecutionOutputBlock]
type: Literal["code_execution_output"]
class EncryptedCodeExecutionResultBlockParam: type: "encrypted_code_execution_result"; content; encrypted_stdout; ... # 2 moreThe output and exit code of Python code that Claude ran with the code execution tool, with standard output in encrypted form, sent back in a later request.
The output and exit code of Python code that Claude ran with the code execution tool, with standard output in encrypted form, sent back in a later request.
content: Iterable[CodeExecutionOutputBlockParam]
class FileDocumentSourceParam: type: "file"; file_id
class FileImageSourceParam: type: "file"; file_id
class ImageBlockParam: type: "image"; source; cache_control; transformations
class ImageTransformationsParam: oversized_imageConfigures 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: Optional[Literal["downsize", "error"]]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.
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: "input_json_delta"; partial_json
type: Literal["input_json_delta"]
class JSONOutputFormatParam: type: "json_schema"; schema
The JSON schema of the format
class MemoryTool20250818Param: type: "memory_20250818"; name; allowed_callers; ... # 4 more
class Message: type: "message"; id; container; ... # 8 more
type MessageContentParam = Union[str, Iterable[Union[TextBlockParam, ImageBlockParam, DocumentBlockParam, 14 more]]]
type MessageCountTokensToolParam = ...
type MessageCreateParamsContainerParam = Optional[MessageCreateParamsContainerParam]Container identifier for reuse across requests.
Container identifier for reuse across requests.
class ContainerParams: id; skillsContainer parameters with skills to be loaded.
Container parameters with skills to be loaded.
Container id
skills: Optional[Iterable[SkillParams]]List of skills to load in the container
List of skills to load in the container
type: Literal["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_id: strSkill ID
Skill ID
version: Optional[str]Skill 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
type MessageParam = ...
class UserMessageParam: content; role
content: MessageContentParam
class AssistantMessageParam: content; role
content: MessageContentParam
class SystemMessageParam: content; role
class MessageTokensCount: input_tokens
The total number of tokens across the provided list of messages, system prompt, and tools.
class MetadataParam: user_id
user_id: Optional[str]An 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.
type Model = Union[Literal["claude-fable-5-2", "claude-mythos-5-2", "claude-haiku-5-5", 19 more], str]The model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
class OutputConfigParam: effort; format
effort: Optional[Literal["low", "medium", "high", 2 more]]How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
Valid values are low, medium, high, xhigh, or max.
format: Optional[JSONOutputFormatParam]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: intNumber 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. 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: "text"; data; media_type
type RawContentBlockDelta = ...
class RawContentBlockDeltaEvent: type: "content_block_delta"; delta; index
type: Literal["content_block_delta"]
delta: RawContentBlockDelta
class RawContentBlockStartEvent: type: "content_block_start"; content_block; index
class RawContentBlockStopEvent: type: "content_block_stop"; index
type: Literal["content_block_stop"]
class RawMessageDeltaEvent: type: "message_delta"; delta; usage
class RawMessageStartEvent: type: "message_start"; message
type: Literal["message_start"]
message: Message
class RawMessageStopEvent: type: "message_stop"
type: Literal["message_stop"]
type RawMessageStreamEvent = ...
class RedactedThinkingBlock: type: "redacted_thinking"; data
type: Literal["redacted_thinking"]
data: strThe 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: "redacted_thinking"; 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: "refusal"; category; explanationStructured information about a refusal.
Structured information about a refusal.
type: Literal["refusal"]
category: Optional[Literal["cyber", "bio", "frontier_llm", 2 more]]The policy category that triggered the refusal.
The policy category that triggered the refusal.
null when the refusal doesn't map to a named category.
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: Optional[str]Human-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: "search_result"; content; source; ... # 3 more
class ServerToolCaller: type: "code_execution_20250825"; tool_idTool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
tool_id: str
class ServerToolCaller20260120: type: "code_execution_20260120"; tool_id
tool_id: str
class ServerToolUsage: web_fetch_requests; web_search_requests
web_fetch_requests: intThe number of web fetch tool requests.
The number of web fetch tool requests.
web_search_requests: intThe number of web search tool requests.
The number of web search tool requests.
class ServerToolUseBlock: type: "server_tool_use"; id; caller; ... # 2 more
class ServerToolUseBlockParam: type: "server_tool_use"; id; input; ... # 3 more
class SignatureDelta: type: "signature_delta"; signature
type: Literal["signature_delta"]
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; versionSpecification for a skill to be loaded in a container.
Specification for a skill to be loaded in a container.
type: Literal["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_id: strSkill ID
Skill ID
version: Optional[str]Skill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
type StopReason = Literal["end_turn", "max_tokens", "stop_sequence", 4 more]
class SystemMessageParam: content; role
class TextBlock: type: "text"; citations; text
class TextBlockParam: type: "text"; text; cache_control; citations
type TextCitation = ...
type TextCitationParam = ...
class TextDelta: type: "text_delta"; text
type: Literal["text_delta"]
class TextEditorCodeExecutionCreateResultBlock: type: "text_editor_code_execution_create_result"; is_file_update
type: Literal["text_editor_code_execution_create_result"]
class TextEditorCodeExecutionCreateResultBlockParam: type: "text_editor_code_execution_create_result"; is_file_update
class TextEditorCodeExecutionStrReplaceResultBlock: type: "text_editor_code_execution_str_replace_result"; lines; new_lines; ... # 3 more
type: Literal["text_editor_code_execution_str_replace_result"]
class TextEditorCodeExecutionStrReplaceResultBlockParam: type: "text_editor_code_execution_str_replace_result"; lines; new_lines; ... # 3 more
class TextEditorCodeExecutionToolResultBlock: type: "text_editor_code_execution_tool_result"; content; tool_use_id
class TextEditorCodeExecutionToolResultBlockParam: type: "text_editor_code_execution_tool_result"; content; tool_use_id; cache_control
class TextEditorCodeExecutionToolResultError: type: "text_editor_code_execution_tool_result_error"; error_code; error_message
type: Literal["text_editor_code_execution_tool_result_error"]
error_code: TextEditorCodeExecutionToolResultErrorCode
type TextEditorCodeExecutionToolResultErrorCode = Literal["invalid_tool_input", "unavailable", "too_many_requests", 2 more]
class TextEditorCodeExecutionToolResultErrorParam: type: "text_editor_code_execution_tool_result_error"; error_code; error_message
error_code: TextEditorCodeExecutionToolResultErrorCode
class TextEditorCodeExecutionViewResultBlock: type: "text_editor_code_execution_view_result"; content; file_type; ... # 3 more
type: Literal["text_editor_code_execution_view_result"]
file_type: Literal["text", "image", "pdf"]
class TextEditorCodeExecutionViewResultBlockParam: type: "text_editor_code_execution_view_result"; content; file_type; ... # 3 more
file_type: Literal["text", "image", "pdf"]
class ThinkingBlock: type: "thinking"; signature; thinking
type: Literal["thinking"]
signature: strA 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: "thinking"; signature; thinking
signature: strThe 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 ThinkingConfigAdaptiveParam: type: "adaptive"; display
display: Optional[Literal["summarized", "omitted"]]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. The default depends on the model; see Controlling thinking display.
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. The default depends on the model; see Controlling thinking display.
class ThinkingConfigBetweenToolsParam: type: "between_tools"
class ThinkingConfigDisabledParam: type: "disabled"
class ThinkingConfigEnabledParam: type: "enabled"; budget_tokens; display
budget_tokens: intDetermines 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: Optional[Literal["summarized", "omitted"]]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. The default depends on the model; see Controlling thinking display.
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. The default depends on the model; see Controlling thinking display.
type ThinkingConfigParam = ...Configuration for Claude's thinking.
Configuration for Claude's thinking.
With {"type": "adaptive"}, Claude decides when and how much to think. With {"type": "enabled"} (manual extended thinking), you set a budget_tokens of at least 1,024. Thinking tokens count toward your max_tokens limit.
Which type values are accepted, and what happens when you omit thinking, depend on the model. See thinking for each model's behavior.
class ThinkingDelta: type: "thinking_delta"; thinking
type: Literal["thinking_delta"]
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 ThreadAlreadyContinuedErrorDetails: error_code
class ThreadContinueInFlightErrorDetails: error_code
class ThreadFingerprintMismatchErrorDetails: error_code
class ThreadNotFoundErrorDetails: error_code
type ThreadUnsupportedFeatureName = Literal["cache_control", "context_management", "fallbacks", 3 more]
class ThreadUnsupportedRequestErrorDetails: error_code; unsupported
unsupported: Optional[List[ThreadUnsupportedFeatureName]]Each entry names a request field or an organization setting that Threads do not support. On a value you do not recognize, send the full conversation without thread.
Each entry names a request field or an organization setting that Threads do not support. On a value you do not recognize, send the full conversation without thread.
class ToolParam: type; input_schema; name; ... # 7 more
class ToolBash20250124Param: type: "bash_20250124"; name; allowed_callers; ... # 4 more
type ToolChoiceParam = ...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 ToolChoiceAnyParam: type: "any"; disable_parallel_tool_useThe model will use any available tools.
The model will use any available tools.
disable_parallel_tool_use: Optional[bool]Whether 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 ToolChoiceAutoParam: type: "auto"; disable_parallel_tool_useThe model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
disable_parallel_tool_use: Optional[bool]Whether 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 ToolChoiceNoneParam: type: "none"The model will not be allowed to use tools.
The model will not be allowed to use tools.
class ToolChoiceToolParam: type: "tool"; name; disable_parallel_tool_useThe 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: Optional[bool]Whether 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 ToolNameConflictErrorDetails: error_code
class ToolReferenceBlock: type: "tool_reference"; tool_name
type: Literal["tool_reference"]
tool_name: str
class ToolReferenceBlockParam: type: "tool_reference"; tool_name; cache_controlTool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
tool_name: str
cache_control: Optional[CacheControlEphemeralParam]Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl: Optional[Literal["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 ToolReferenceUnresolvedErrorDetails: error_code
class ToolResultBlockParam: type: "tool_result"; tool_use_id; cache_control; ... # 3 more
class ToolSearchToolBm25_20251119Param: type; name; allowed_callers; ... # 3 more
class ToolSearchToolRegex20251119Param: type; name; allowed_callers; ... # 3 more
class ToolSearchToolResultBlock: type: "tool_search_tool_result"; content; tool_use_id
class ToolSearchToolResultBlockParam: type: "tool_search_tool_result"; content; tool_use_id; cache_control
class ToolSearchToolResultError: type: "tool_search_tool_result_error"; error_code; error_message
type: Literal["tool_search_tool_result_error"]
error_code: ToolSearchToolResultErrorCode
type ToolSearchToolResultErrorCode = Literal["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]
class ToolSearchToolResultErrorParam: type: "tool_search_tool_result_error"; error_code; error_message
error_code: ToolSearchToolResultErrorCode
class ToolSearchToolSearchResultBlock: type: "tool_search_tool_search_result"; tool_references
type: Literal["tool_search_tool_search_result"]
tool_references: List[ToolReferenceBlock]
type: Literal["tool_reference"]
tool_name: str
class ToolSearchToolSearchResultBlockParam: type: "tool_search_tool_search_result"; tool_references
tool_references: Iterable[ToolReferenceBlockParam]
tool_name: str
cache_control: Optional[CacheControlEphemeralParam]Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
ttl: Optional[Literal["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 ToolTextEditor20250124Param: type: "text_editor_20250124"; name; allowed_callers; ... # 4 more
class ToolTextEditor20250429Param: type: "text_editor_20250429"; name; allowed_callers; ... # 4 more
class ToolTextEditor20250728Param: type: "text_editor_20250728"; name; allowed_callers; ... # 5 more
type ToolUnionParam = ...
class ToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class ToolUseBlockParam: type: "tool_use"; id; input; ... # 4 more
type ToolUseCaller = ...Which party invoked the tool call: the model directly, or a server tool on its behalf.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class DirectCaller: type: "direct"Tool invocation directly from the model.
Tool invocation directly from the model.
class ServerToolCaller: type: "code_execution_20250825"; tool_idTool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
tool_id: str
class ServerToolCaller20260120: type: "code_execution_20260120"; tool_id
tool_id: str
type ToolsetToolUseBlock = ...
type BrowserToolUseBlock = ...
type ComputerToolUseBlock = ...
class ToolUseBlock: type: "tool_use"; id; caller; ... # 3 more
class URLImageSourceParam: type: "url"; url
class URLPDFSourceParam: type: "url"; url
class Usage: cache_creation; cache_creation_input_tokens; cache_read_input_tokens; ... # 7 more
class UserLocationParam: type: "approximate"; city; country; ... # 2 more
city: Optional[str]The city of the user.
The city of the user.
country: Optional[str]The two letter ISO country code of the user.
The two letter ISO country code of the user.
region: Optional[str]The region of the user.
The region of the user.
timezone: Optional[str]The IANA timezone of the user.
The IANA timezone of the user.
class UserMessageParam: content; role
content: MessageContentParam
class WebFetchBlock: type: "web_fetch_result"; content; retrieved_at; url
type: Literal["web_fetch_result"]
content: DocumentBlock
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class WebFetchBlockParam: type: "web_fetch_result"; content; url; retrieved_at
content: DocumentBlockParam
Fetched content URL
ISO 8601 timestamp when the content was retrieved
class WebFetchTool20250910Param: type: "web_fetch_20250910"; name; allowed_callers; ... # 9 more
class WebFetchTool20260209Param: type: "web_fetch_20260209"; name; allowed_callers; ... # 9 more
class WebFetchTool20260309Param: type: "web_fetch_20260309"; name; allowed_callers; ... # 10 moreWeb fetch tool with use_cache parameter for bypassing cached content.
Web fetch tool with use_cache parameter for bypassing cached content.
class WebFetchTool20260318Param: type: "web_fetch_20260318"; name; allowed_callers; ... # 11 more
class WebFetchToolResultBlock: type: "web_fetch_tool_result"; caller; content; tool_use_id
class WebFetchToolResultBlockParam: type: "web_fetch_tool_result"; content; tool_use_id; ... # 2 more
class WebFetchToolResultErrorBlock: type: "web_fetch_tool_result_error"; error_code
type: Literal["web_fetch_tool_result_error"]
error_code: WebFetchToolResultErrorCode
class WebFetchToolResultErrorBlockParam: type: "web_fetch_tool_result_error"; error_code
error_code: WebFetchToolResultErrorCode
type WebFetchToolResultErrorCode = Literal["invalid_tool_input", "url_too_long", "url_not_allowed", 7 more]
class WebFetchURLSourceAllParam: type: "all"The url_sources variant under which a source contributes in
full: every result of the tool filter's source, or all user input.
The url_sources variant under which a source contributes in
full: every result of the tool filter's source, or all user input.
class WebFetchURLSourceExceptParam: type: "except"; toolsThe tool filter variant under which every result but the named
tools' contributes.
The tool filter variant under which every result but the named tools' contributes.
tools: Iterable[WebFetchURLSourceToolReferenceParam]
class WebFetchURLSourceNoneParam: type: "none"The url_sources variant under which a source contributes nothing:
no result of the tool filter's source, or no user input.
The url_sources variant under which a source contributes nothing:
no result of the tool filter's source, or no user input.
class WebFetchURLSourceOnlyParam: type: "only"; toolsThe tool filter variant under which only the named tools' results
contribute.
The tool filter variant under which only the named tools' results contribute.
tools: Iterable[WebFetchURLSourceToolReferenceParam]
class WebFetchURLSourceToolReferenceParam: type: "tool_reference"; nameOne entry of a tool filter's tools: it must name a tool declared
in this request's tools[].
One entry of a tool filter's tools: it must name a tool declared
in this request's tools[].
class WebFetchURLSourcesParam: client_tool_results; server_tool_results; user_inputWhich sources contribute to the set of URLs web fetch may fetch.
Which sources contribute to the set of URLs web fetch may fetch.
Each key is a tagged variant: user_input is all or none; the
two tool filters are all, none, only (only the named tools'
results) or except (every result but the named tools'). A named tool
must be declared in this request's tools[].
class WebSearchResultBlock: type: "web_search_result"; encrypted_content; page_age; ... # 2 more
type: Literal["web_search_result"]
class WebSearchResultBlockParam: type: "web_search_result"; encrypted_content; title; ... # 2 more
class WebSearchTool20250305Param: type: "web_search_20250305"; name; allowed_callers; ... # 7 more
class WebSearchTool20260209Param: type: "web_search_20260209"; name; allowed_callers; ... # 7 more
class WebSearchTool20260318Param: type: "web_search_20260318"; name; allowed_callers; ... # 8 more
class WebSearchToolRequestErrorParam: type: "web_search_tool_result_error"; error_code
error_code: WebSearchToolResultErrorCode
class WebSearchToolResultBlock: type: "web_search_tool_result"; caller; content; tool_use_id
type WebSearchToolResultBlockContent = ...
class WebSearchToolResultBlockParam: type: "web_search_tool_result"; content; tool_use_id; ... # 2 more
type WebSearchToolResultBlockParamContentParam = ...
class WebSearchToolResultError: type: "web_search_tool_result_error"; error_code
type: Literal["web_search_tool_result_error"]
error_code: WebSearchToolResultErrorCode
type WebSearchToolResultErrorCode = Literal["invalid_tool_input", "unavailable", "max_uses_exceeded", 3 more]
Errors
class AvailableToolsLimitExceededError(BadRequestError): error_code; detailsThe tools available after a message exceed a limit on their number or their size.
The tools available after a message exceed a limit on their number or their size.
class CompactionBlockAmbiguousError(BadRequestError): error_code; detailsmessages holds more than one compaction block with content. Send only the block the conversation returned last.
messages holds more than one compaction block with content. Send only the block the conversation returned last.
details: CompactionBlockAmbiguousErrorDetails
class CompactionBlockMisplacedError(BadRequestError): error_code; detailsThe compaction block is not the first block of the conversation, or is in a system message.
The compaction block is not the first block of the conversation, or is in a system message.
details: CompactionBlockMisplacedErrorDetails
class CompactionContentMismatchError(BadRequestError): error_code; detailsThe compaction block's content differs from the text its signature recorded.
The compaction block's content differs from the text its signature recorded.
class CompactionIncompleteTurnError(BadRequestError): error_code; detailsThe compaction request ends on an assistant turn that is not finished.
The compaction request ends on an assistant turn that is not finished.
details: CompactionIncompleteTurnErrorDetails
class CompactionNothingToSummarizeError(BadRequestError): error_code; detailsmessages holds no user or assistant content to summarize or adopt.
messages holds no user or assistant content to summarize or adopt.
class CompactionSignatureInvalidError(BadRequestError): error_code; detailsThe compaction block's signature does not verify.
The compaction block's signature does not verify.
class CompactionTooManyToolReferencesError(BadRequestError): error_code; detailsThe conversation references more distinct tools than a compaction block can record.
The conversation references more distinct tools than a compaction block can record.
class CompactionToolChangesMismatchError(BadRequestError): error_code; detailsThe compaction block's tool_changes differs from what was returned with the block.
The compaction block's tool_changes differs from what was returned with the block.
class ThreadAlreadyContinuedError(BadRequestError): error_code; detailsThe response that previous_message_id names has already been continued, and each response can be continued only once. Continue from the Thread's most recent response id.
The response that previous_message_id names has already been continued, and each response can be continued only once. Continue from the Thread's most recent response id.
details: ThreadAlreadyContinuedErrorDetails
class ThreadContinueInFlightError(BadRequestError): error_code; detailsAnother request is still continuing from the same previous_message_id. Wait for it to complete and continue from its response id, or replay the full conversation with thread: {"type": "create"}.
Another request is still continuing from the same previous_message_id. Wait for it to complete and continue from its response id, or replay the full conversation with thread: {"type": "create"}.
details: ThreadContinueInFlightErrorDetails
class ThreadFingerprintMismatchError(BadRequestError): error_code; detailsA field that must stay the same across a Thread's turns differs from the value stored with the Thread; the message names each such field. Send the stored values, or replay the full conversation with thread: {"type": "create"} to change them.
A field that must stay the same across a Thread's turns differs from the value stored with the Thread; the message names each such field. Send the stored values, or replay the full conversation with thread: {"type": "create"} to change them.
class ThreadUnsupportedRequestError(BadRequestError): error_code; detailsThe request combines thread with a request field or an organization setting that Threads do not support; unsupported, when present, names it. Send the full conversation without thread, or change that field.
The request combines thread with a request field or an organization setting that Threads do not support; unsupported, when present, names it. Send the full conversation without thread, or change that field.
details: ThreadUnsupportedRequestErrorDetails
unsupported: Optional[List[ThreadUnsupportedFeatureName]]Each entry names a request field or an organization setting that Threads do not support. On a value you do not recognize, send the full conversation without thread.
Each entry names a request field or an organization setting that Threads do not support. On a value you do not recognize, send the full conversation without thread.
class ToolNameConflictError(BadRequestError): error_code; detailsA tool made available in messages takes a name that an available tool of another kind, or of another MCP server, already holds.
A tool made available in messages takes a name that an available tool of another kind, or of another MCP server, already holds.
details: ToolNameConflictErrorDetails
class ToolReferenceUnresolvedError(BadRequestError): error_code; detailsA tool change or MCP tool listing references a tool or MCP server that is not defined at that position in the conversation.
A tool change or MCP tool listing references a tool or MCP server that is not defined at that position in the conversation.
details: ToolReferenceUnresolvedErrorDetails
class ThreadNotFoundError(NotFoundError): error_code; detailsNo usable Thread state was found for previous_message_id. Replay the full conversation with thread: {"type": "create"} to start a new Thread.
No usable Thread state was found for previous_message_id. Replay the full conversation with thread: {"type": "create"} to start a new Thread.
details: ThreadNotFoundErrorDetails
class CompactionUnavailableError(OverloadedError): error_code; detailsThe compaction could not be completed for a transient server reason. Retry the request.
The compaction could not be completed for a transient server reason. Retry the request.
details: CompactionUnavailableErrorDetails
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) -> SyncPage[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) -> JSONLDecoder[MessageBatchIndividualResponse]Streams the results of a Message Batch as a .jsonl file.