Claude Platform Docs

Сообщения

Создать сообщение
$client->messages->create(int maxTokens, list<MessageParam> messages, Model model, ?CacheControlEphemeral cacheControl, ?MessageCreateParamsContainer container, ?DiagnosticsParam diagnostics, ?string inferenceGeo, ?Metadata metadata, ?OutputConfig outputConfig, ?ServiceTier serviceTier, ?Speed speed, ?list<string> stopSequences, ?System system, ?ThinkingConfigParam thinking, ?ToolChoice toolChoice, ?list<ToolUnion> tools, ?string userProfileID, ?string workspaceID): Message
POST/v1/messages

Отправьте структурированный список входных сообщений с текстом и/или изображениями, и модель сгенерирует следующее сообщение в разговоре.

Подсчитать токены в сообщении
$client->messages->countTokens(list<MessageParam> messages, Model model, ?CacheControlEphemeral cacheControl, ?OutputConfig outputConfig, ?Speed speed, ?System system, ?ThinkingConfigParam thinking, ?ToolChoice toolChoice, ?list<MessageCountTokensTool> tools, ?string userProfileID, ?string workspaceID): MessageTokensCount
POST/v1/messages/count_tokens

Подсчитайте количество токенов в сообщении.

Models
class AssistantMessageParam { $content; $role; }
"assistant" role
class Base64ImageSource { $type = 'base64'; $data; $mediaType; }
"base64" type
string data
MediaType mediaType
class Base64PDFSource { $type = 'base64'; $data; $mediaType; }
"base64" type
string data
"application/pdf" mediaType
class BashCodeExecutionOutputBlock { $type = 'bash_code_execution_output'; $fileID; }
"bash_code_execution_output" type
string fileID
class BashCodeExecutionOutputBlockParam { $type = 'bash_code_execution_output'; $fileID; }
"bash_code_execution_output" type
string fileID
class BashCodeExecutionResultBlock { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
"bash_code_execution_result" type
int returnCode
string stderr
string stdout
class BashCodeExecutionResultBlockParam { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
"bash_code_execution_result" type
int returnCode
string stderr
string stdout
class BashCodeExecutionToolResultBlock { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; }
"bash_code_execution_tool_result" type
Content content
string toolUseID
class BashCodeExecutionToolResultBlockParam { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
"bash_code_execution_tool_result" type
Content content
string toolUseID
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BashCodeExecutionToolResultError { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
"bash_code_execution_tool_result_error" type
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
class BashCodeExecutionToolResultErrorParam { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
"bash_code_execution_tool_result_error" type
One of the following:
class BrowserCoordinateTarget { $type = 'coordinate'; $x; $y; }
"coordinate" type
int x

Pixels from the left edge of the viewport.

int y

Pixels from the top edge of the viewport.

class BrowserRefTarget { $type = 'ref'; $ref; }
"ref" type
string ref

An element reference (e.g. "ref_7") returned by a prior read_page or find result.

class BrowserCloseTabConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $tabID; }
string tabID

The tab to close.

class BrowserCloseTabToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Close the tab with the given tab_id.

"close_tab" name
"browser" toolsetName
class BrowserCoordinateTarget { $type = 'coordinate'; $x; $y; }
"coordinate" type
int x

Pixels from the left edge of the viewport.

int y

Pixels from the top edge of the viewport.

class BrowserDoubleClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

Where to act: either a viewport coordinate or an element reference.

?string modifiers

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserDoubleClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Double left-click at a viewport coordinate or on an element by reference.

"double_click" name
"browser" toolsetName
class BrowserFileUploadConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $documentIDs; $paths; $tabID; }

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.

?list<string> documentIDs

References to files the harness has staged, for deployments where the browser executor cannot read the caller's filesystem.

?list<string> paths

File paths on the browser executor's filesystem.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserFileUploadToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"file_upload" name
"browser" toolsetName
class BrowserFindConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }
string query

Natural-language description of the element(s) to find.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserFindToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Find elements matching a natural-language description (e.g. "search bar", "add to cart button") and return up to 20 matches with element references.

"find" name
"browser" toolsetName
class BrowserFormInputConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

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.

The value to set.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserFormInputToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Set the value of a form element (input, textarea, select, checkbox). Use a boolean for checkboxes, an option value or text for selects.

"form_input" name
"browser" toolsetName
One of the following:
string
float
bool
class BrowserGetPageTextConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $tabID; }
?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserGetPageTextToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Return the page's visible text content as plain text, prioritizing article content. Suited to articles, documentation, and other text-heavy pages.

"get_page_text" name
"browser" toolsetName
class BrowserHoldKeyConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }
float duration

Seconds to hold the key down (maximum 30).

string text

The key or chord to hold.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserHoldKeyToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"hold_key" name
"browser" toolsetName
class BrowserHoverConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

Where to act: either a viewport coordinate or an element reference.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserHoverToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Move the cursor to a coordinate or element without clicking.

"hover" name
"browser" toolsetName
class BrowserJavascriptExecConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }
string text

JavaScript to execute in the page context.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserJavascriptExecToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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_exec" name
"browser" toolsetName
class BrowserKeyConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }
string text

The key, chord, or space-separated sequence to press.

?int repeat

Number of times to repeat. Default 1.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserKeyToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"key" name
"browser" toolsetName
class BrowserLeftClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

class BrowserLeftClickDragConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

A 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).

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserLeftClickDragToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Press at from, drag to target, release. Both must be coordinate targets.

"left_click_drag" name
"browser" toolsetName
class BrowserLeftClickInput { $target; $modifiers; $tabID; }

Where to act: either a viewport coordinate or an element reference.

?string modifiers

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserLeftClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Left-click at a viewport coordinate or on an element by reference.

"left_click" name
"browser" toolsetName
class BrowserLeftMouseDownConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserLeftMouseDownToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Press and hold the left mouse button at a viewport coordinate. Pair with left_mouse_up to perform a custom drag.

"left_mouse_down" name
"browser" toolsetName
class BrowserLeftMouseUpConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserLeftMouseUpToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Release the left mouse button at a viewport coordinate.

"left_mouse_up" name
"browser" toolsetName
class BrowserListTabsConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 BrowserListTabsToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

List all open tabs with each tab's tab_id, title, and URL.

"list_tabs" name
"browser" toolsetName
class BrowserMiddleClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

Where to act: either a viewport coordinate or an element reference.

?string modifiers

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserMiddleClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Middle-click at a viewport coordinate or on an element by reference.

"middle_click" name
"browser" toolsetName
class BrowserMouseMoveConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserMouseMoveToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Move the pointer to a viewport coordinate without clicking.

"mouse_move" name
"browser" toolsetName
class BrowserNavigateConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }
string url

The URL to navigate to, or "back" / "forward" / "reload" for history navigation.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserNavigateToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Navigate to a URL, or go back/forward/reload in history. The protocol may be omitted (defaults to https://).

"navigate" name
"browser" toolsetName
class BrowserNewTabConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 BrowserNewTabToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Open a new empty tab and return its tab_id.

"new_tab" name
"browser" toolsetName
class BrowserReadConsoleConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $tabID; }
?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserReadConsoleToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"read_console" name
"browser" toolsetName
class BrowserReadNetworkConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $tabID; }
?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserReadNetworkToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"read_network" name
"browser" toolsetName
class BrowserReadPageConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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.

One of the following:
"all"
"interactive"
class BrowserReadPageInput { $depth; $filter; $ref; $tabID; }
?int depth

Maximum tree depth. Default 15.

Which elements to include. Omitted: every visible element. "interactive": interactive elements only. "all": additionally includes off-viewport elements.

?string ref

Element reference to read a subtree from. Omit to read from the page root.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserReadPageToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"read_page" name
"browser" toolsetName
class BrowserRefTarget { $type = 'ref'; $ref; }
"ref" type
string ref

An element reference (e.g. "ref_7") returned by a prior read_page or find result.

class BrowserRightClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

Where to act: either a viewport coordinate or an element reference.

?string modifiers

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserRightClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Right-click at a viewport coordinate or on an element by reference.

"right_click" name
"browser" toolsetName
class BrowserScreenshotConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $tabID; }
?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserScreenshotToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Capture the current browser viewport.

"screenshot" name
"browser" toolsetName
class BrowserScrollConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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.

One of the following:
"up"
"down"
"left"
"right"
class BrowserScrollInput { $scrollDirection; $target; $scrollAmount; $tabID; }
BrowserScrollDirection scrollDirection

A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).

?int scrollAmount

Scroll-wheel notches (1–10). Default 3.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserScrollToConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

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.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserScrollToToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Scroll an element into view.

"scroll_to" name
"browser" toolsetName
class BrowserScrollToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Scroll at a viewport position. target must be a coordinate target.

"scroll" name
"browser" toolsetName
class BrowserStateBlockParam { $type = 'browser_state'; $tabs; $cacheControl; $stateChanges; }
"browser_state" type
list<BrowserStateTabEntry> tabs

All tabs open in the browser after this call — the full inventory, not a delta. May be empty. Whenever non-empty, exactly one entry carries active: true.

?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?list<BrowserStateChange> stateChanges

Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.

One of the following:
class BrowserStateChangeDownloadCompleted { $type = 'download_completed'; $downloadID; $url; /* 2 more */ }
"download_completed" type
string downloadID

The caller-assigned identifier for this download, stable across the state changes reporting it.

string url

The final post-redirect URL the download was served from.

?string 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.

?int sizeBytes

The completed download's size.

class BrowserStateChangeDownloadFailed { $type = 'download_failed'; $downloadID; $url; $error; }
"download_failed" type
string downloadID

The caller-assigned identifier for this download, stable across the state changes reporting it.

string url

The final post-redirect URL the download was served from.

?string error

The failure or cancellation detail, when known.

class BrowserStateChangeDownloadStarted { $type = 'download_started'; $downloadID; $url; }
"download_started" type
string downloadID

The caller-assigned identifier for this download, stable across the state changes reporting it.

string url

The final post-redirect URL the download was served from.

class BrowserStateChangeTabOpened { $type = 'tab_opened'; $tabID; }
"tab_opened" type
string tabID

The tab_id of the opened tab, present in tabs.

class BrowserStateTabEntry { $tabID; $title; $url; $active; }
string tabID

The caller-assigned identifier for this tab, unique within the inventory.

string title

The title of the page the tab is showing. May be empty.

string url

The URL of the page the tab is showing. May be empty.

?bool active

Whether this tab is the active tab after this call. Whenever tabs is non-empty, exactly one entry is marked active: true.

class BrowserSwitchTabConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $tabID; }
string tabID

The tab to switch to.

class BrowserSwitchTabToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Make the tab with the given tab_id the active tab — the tab that actions without a tab_id apply to.

"switch_tab" name
"browser" toolsetName
One of the following:
class BrowserToolset20260801 { $type = 'browser_toolset_20260801'; $cacheControl; $configs; }
"browser_toolset_20260801" type
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.

class BrowserToolsetConfigs { $type; $closeTab; $doubleClick; /* 28 more */ }
class BrowserTripleClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }

Where to act: either a viewport coordinate or an element reference.

?string modifiers

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserTripleClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Triple left-click at a viewport coordinate or on an element by reference (typically selects a line or paragraph).

"triple_click" name
"browser" toolsetName
class BrowserTypeConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }
string text

The text to type.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserTypeToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Type a literal string at the current focus.

"type" name
"browser" toolsetName
class BrowserWaitConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }
float duration

Seconds to wait (maximum 30).

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserWaitToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Pause for the given duration.

"wait" name
"browser" toolsetName
class BrowserZoomConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $tabID; }
list<int> region

[x0, y0, x1, y1] in viewport pixels.

?string tabID

Tab to act on. Defaults to the active tab when omitted.

class BrowserZoomToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"zoom" name
"browser" toolsetName
class CacheControlEphemeral { $type = 'ephemeral'; $ttl; }
"ephemeral" type
?TTL ttl

The time-to-live for the cache control breakpoint.

This may be one the following values:

  • 5m: 5 minutes
  • 1h: 1 hour

Defaults to 5m. See prompt caching pricing for details.

class CacheCreation { $ephemeral1hInputTokens; $ephemeral5mInputTokens; }
int ephemeral1hInputTokens

The number of input tokens used to create the 1 hour cache entry.

int ephemeral5mInputTokens

The number of input tokens used to create the 5 minute cache entry.

class CacheMissMessagesChanged { $type = 'messages_changed'; $cacheMissedInputTokens; }
"messages_changed" type
int cacheMissedInputTokens

Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

class CacheMissModelChanged { $type = 'model_changed'; $cacheMissedInputTokens; }
"model_changed" type
int cacheMissedInputTokens

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'; }
"previous_message_not_found" type
One of the following:
class CacheMissSystemChanged { $type = 'system_changed'; $cacheMissedInputTokens; }
"system_changed" type
int cacheMissedInputTokens

Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

class CacheMissToolsChanged { $type = 'tools_changed'; $cacheMissedInputTokens; }
"tools_changed" type
int cacheMissedInputTokens

Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

class CacheMissUnavailable { $type = 'unavailable'; }
"unavailable" type
class CitationCharLocation { $type = 'char_location'; $citedText; $documentIndex; /* 4 more */ }
"char_location" type
string citedText
int documentIndex
?string documentTitle
int endCharIndex
?string fileID
int startCharIndex
class CitationCharLocationParam { $type = 'char_location'; $citedText; $documentIndex; /* 3 more */ }
"char_location" type
string citedText
int documentIndex
?string documentTitle
int endCharIndex
int startCharIndex
class CitationContentBlockLocation { $type = 'content_block_location'; $citedText; $documentIndex; /* 4 more */ }
"content_block_location" type
string citedText

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.

int documentIndex
?string documentTitle
int endBlockIndex

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.

?string fileID
int startBlockIndex

0-based index of the first cited block in the source's content array.

class CitationContentBlockLocationParam { $type = 'content_block_location'; $citedText; $documentIndex; /* 3 more */ }
"content_block_location" type
string citedText

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.

int documentIndex
?string documentTitle
int endBlockIndex

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.

int startBlockIndex

0-based index of the first cited block in the source's content array.

class CitationPageLocation { $type = 'page_location'; $citedText; $documentIndex; /* 4 more */ }
"page_location" type
string citedText
int documentIndex
?string documentTitle
int endPageNumber
?string fileID
int startPageNumber
class CitationPageLocationParam { $type = 'page_location'; $citedText; $documentIndex; /* 3 more */ }
"page_location" type
string citedText
int documentIndex
?string documentTitle
int endPageNumber
int startPageNumber
class CitationSearchResultLocationParam { $type = 'search_result_location'; $citedText; $endBlockIndex; /* 4 more */ }
"search_result_location" type
string citedText

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.

int endBlockIndex

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.

int searchResultIndex

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.

string source
int startBlockIndex

0-based index of the first cited block in the source's content array.

?string title
class CitationWebSearchResultLocationParam { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
"web_search_result_location" type
string citedText
string encryptedIndex
?string title
string url
class CitationsConfig { $enabled; }
bool enabled
class CitationsConfigParam { $enabled; }
?bool enabled
class CitationsDelta { $type = 'citations_delta'; $citation; }
"citations_delta" type
Citation citation
class CitationsSearchResultLocation { $type = 'search_result_location'; $citedText; $endBlockIndex; /* 4 more */ }
"search_result_location" type
string citedText

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.

int endBlockIndex

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.

int searchResultIndex

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.

string source
int startBlockIndex

0-based index of the first cited block in the source's content array.

?string title
class CitationsWebSearchResultLocation { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
"web_search_result_location" type
string citedText
string encryptedIndex
?string title
string url
class CodeExecutionOutputBlock { $type = 'code_execution_output'; $fileID; }
"code_execution_output" type
string fileID
class CodeExecutionOutputBlockParam { $type = 'code_execution_output'; $fileID; }
"code_execution_output" type
string fileID
class CodeExecutionResultBlock { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
"code_execution_result" type
list<CodeExecutionOutputBlock> content
int returnCode
string stderr
string stdout
class CodeExecutionResultBlockParam { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
"code_execution_result" type
int returnCode
string stderr
string stdout
class CodeExecutionTool20250522 { $type = 'code_execution_20250522'; $name; $allowedCallers; /* 3 more */ }
"code_execution_20250522" type
"code_execution" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?bool strict

When true, guarantees schema validation on tool names and inputs

class CodeExecutionTool20250825 { $type = 'code_execution_20250825'; $name; $allowedCallers; /* 3 more */ }
"code_execution_20250825" type
"code_execution" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?bool strict

When true, guarantees schema validation on tool names and inputs

class CodeExecutionTool20260120 { $type = 'code_execution_20260120'; $name; $allowedCallers; /* 3 more */ }
"code_execution_20260120" type
"code_execution" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?bool strict

When true, guarantees schema validation on tool names and inputs

class CodeExecutionTool20260521 { $type = 'code_execution_20260521'; $name; $allowedCallers; /* 3 more */ }
"code_execution_20260521" type
"code_execution" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?bool strict

When true, guarantees schema validation on tool names and inputs

class CodeExecutionToolResultBlock { $type = 'code_execution_tool_result'; $content; $toolUseID; }
"code_execution_tool_result" type
string toolUseID
One of the following:
class CodeExecutionToolResultBlockParam { $type = 'code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
"code_execution_tool_result" type
string toolUseID
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

One of the following:
class CodeExecutionToolResultError { $type = 'code_execution_tool_result_error'; $errorCode; }
"code_execution_tool_result_error" type
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
class CodeExecutionToolResultErrorParam { $type = 'code_execution_tool_result_error'; $errorCode; }
"code_execution_tool_result_error" type
class ComputerCursorPositionConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 ComputerCursorPositionToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Get the current (x, y) pixel coordinate of the cursor.

"cursor_position" name
"computer" toolsetName
class ComputerDoubleClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $text; }
?list<int> coordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

?string text

Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").

class ComputerDoubleClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Double-click the left mouse button at the specified (x, y) pixel coordinate, or the current cursor position if coordinate is omitted.

"double_click" name
"computer" toolsetName
class ComputerHoldKeyConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $text; }
int duration

Duration to hold the key, in seconds.

string text

The key or key-combination to hold.

class ComputerHoldKeyToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Hold down a key or key-combination for a specified duration. Uses the same key syntax as key.

"hold_key" name
"computer" toolsetName
class ComputerKeyConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $repeat; }
string text

The key or key-combination to press.

?int repeat

Number of times to repeat the key press. Default is 1.

class ComputerKeyToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"key" name
"computer" toolsetName
class ComputerLeftClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

class ComputerLeftClickDragConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $startCoordinate; $text; }
list<int> coordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

list<int> startCoordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

?string text

Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").

class ComputerLeftClickDragToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Click and drag the cursor from start_coordinate to coordinate.

"left_click_drag" name
"computer" toolsetName
class ComputerLeftClickInput { $coordinate; $text; }
?list<int> coordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

?string text

Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").

class ComputerLeftClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Click the left mouse button at the specified (x, y) pixel coordinate, or the current cursor position if coordinate is omitted.

"left_click" name
"computer" toolsetName
class ComputerLeftMouseDownConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 ComputerLeftMouseDownToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Press and hold the left mouse button at the current cursor position.

"left_mouse_down" name
"computer" toolsetName
class ComputerLeftMouseUpConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 ComputerLeftMouseUpToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Release the left mouse button.

"left_mouse_up" name
"computer" toolsetName
class ComputerMiddleClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $text; }
?list<int> coordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

?string text

Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").

class ComputerMiddleClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Click the middle mouse button at the specified (x, y) pixel coordinate, or the current cursor position if coordinate is omitted.

"middle_click" name
"computer" toolsetName
class ComputerMouseMoveConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $coordinate; }
list<int> coordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

class ComputerMouseMoveToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Move the cursor to a specified (x, y) pixel coordinate. Use this ONLY to hover without clicking; otherwise use a click action directly.

"mouse_move" name
"computer" toolsetName
class ComputerRightClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $text; }
?list<int> coordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

?string text

Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").

class ComputerRightClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Click the right mouse button at the specified (x, y) pixel coordinate, or the current cursor position if coordinate is omitted.

"right_click" name
"computer" toolsetName
class ComputerScreenshotConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 ComputerScreenshotToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Take a screenshot of the screen.

"screenshot" name
"computer" toolsetName
class ComputerScrollConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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.

One of the following:
"up"
"down"
"left"
"right"
class ComputerScrollInput { $scrollAmount; $scrollDirection; $coordinate; $text; }
int scrollAmount

Number of 'clicks' of the scroll wheel.

ComputerScrollDirection scrollDirection
?list<int> coordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

?string text

Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").

class ComputerScrollToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"scroll" name
"computer" toolsetName
One of the following:
class ComputerToolset20260801 { $type = 'computer_toolset_20260801'; $cacheControl; $configs; }
"computer_toolset_20260801" type
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.

class ComputerToolsetConfigs { $type; $cursorPosition; $doubleClick; /* 14 more */ }
class ComputerTripleClickConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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; $text; }
?list<int> coordinate

(x, y): x pixels from the left edge, y pixels from the top edge.

?string text

Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").

class ComputerTripleClickToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Triple-click the left mouse button at the specified (x, y) pixel coordinate, or the current cursor position if coordinate is omitted.

"triple_click" name
"computer" toolsetName
class ComputerTypeConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $text; }
string text

The text to type.

class ComputerTypeToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Type a string of text on the keyboard.

"type" name
"computer" toolsetName
class ComputerWaitConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $duration; }
int duration

Duration to wait, in seconds.

class ComputerWaitToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

Wait for a specified duration.

"wait" name
"computer" toolsetName
class ComputerZoomConfig { $deferLoading; $enabled; }
?bool deferLoading

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

?bool enabled

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 { $region; }
list<int> region

(x0, y0, x1, y1): The region to capture.

class ComputerZoomToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
ToolUseCaller caller

Which party invoked the tool call: the model directly, or a server tool on its behalf.

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.

"zoom" name
"computer" toolsetName
class Container { $id; $expiresAt; $skills; }
string id

Identifier for the container used in this request

\Datetime expiresAt

The time at which the container will expire.

?list<ContainerSkill> skills

Skills loaded in the container

class ContainerParams { $id; $skills; }
?string id

Container id

?list<SkillParams> skills

List of skills to load in the container

class ContainerSkill { $type; $skillID; $version; }
Type type

Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

string skillID

Skill ID

string version

The resolved version: a skill version ID for custom skills.

class ContainerUploadBlock { $type = 'container_upload'; $fileID; }
"container_upload" type
string fileID
class ContainerUploadBlockParam { $type = 'container_upload'; $fileID; $cacheControl; }
"container_upload" type
string fileID
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class ContentBlock
One of the following:
One of the following:
class ContentBlockSource { $type = 'content'; $content; }
"content" type
Content content
One of the following:
class Diagnostics { $cacheMissReason; }
?CacheMissReason 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.

class DiagnosticsParam { $previousMessageID; }
?string previousMessageID

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'; }
"direct" type
class DocumentBlock { $type = 'document'; $citations; $source; $title; }
"document" type
?CitationsConfig citations

Citation configuration for the document

Source source
?string title

The title of the document

class DocumentBlockParam { $type = 'document'; $source; $cacheControl; /* 3 more */ }
"document" type
Source source
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?CitationsConfigParam citations
?string context
?string title
class EncryptedCodeExecutionResultBlock { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
"encrypted_code_execution_result" type
list<CodeExecutionOutputBlock> content
string encryptedStdout
int returnCode
string stderr
class EncryptedCodeExecutionResultBlockParam { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
"encrypted_code_execution_result" type
string encryptedStdout
int returnCode
string stderr
class FileDocumentSource { $type = 'file'; $fileID; }
"file" type
string fileID
class FileImageSource { $type = 'file'; $fileID; }
"file" type
string fileID
class ImageBlockParam { $type = 'image'; $source; $cacheControl; $transformations; }
"image" type
Source source
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?ImageTransformationsParam transformations

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.

class ImageTransformationsParam { $oversizedImage; }
?OversizedImage oversizedImage

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'; $partialJSON; }
"input_json_delta" type
string partialJSON
class JSONOutputFormat { $type = 'json_schema'; $schema; }
"json_schema" type
array<string,mixed> schema

The JSON schema of the format

class MemoryTool20250818 { $type = 'memory_20250818'; $name; $allowedCallers; /* 4 more */ }
"memory_20250818" type
"memory" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?list<array<string,mixed>> inputExamples
?bool strict

When true, guarantees schema validation on tool names and inputs

class Message { $type = 'message'; $id; $container; /* 8 more */ }
One of the following:
One of the following:
One of the following:
class ContainerParams { $id; $skills; }
?string id

Container id

?list<SkillParams> skills

List of skills to load in the container

string
class MessageDeltaUsage { $cacheCreationInputTokens; $cacheReadInputTokens; $inputTokens; /* 3 more */ }
?int cacheCreationInputTokens

The cumulative number of input tokens used to create the cache entry.

?int cacheReadInputTokens

The cumulative number of input tokens read from the cache.

?int inputTokens

The cumulative number of input tokens which were used.

int outputTokens

The cumulative number of output tokens which were used.

?OutputTokensDetails outputTokensDetails

Breakdown of output tokens by category.

output_tokens remains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you.

?ServerToolUsage serverToolUse

The number of server tool requests.

class MessageParam
One of the following:
class UserMessageParam { $content; $role; }
"user" role
class AssistantMessageParam { $content; $role; }
"assistant" role
class SystemMessageParam { $content; $role; }
Content content
"system" role
class MessageTokensCount { $inputTokens; }
int inputTokens

The total number of tokens across the provided list of messages, system prompt, and tools.

class Metadata { $userID; }
?string userID

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.

enum Model
One of the following:
"claude-haiku-5-5"

Fastest model for high-volume, real-time tasks

"claude-sonnet-5-5"

Efficient model for coding and agents

"claude-fable-5-1"

Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows

"claude-opus-5-5"

Powerful intelligence for coding, knowledge work, and long-running agents

"claude-mythos-5-1"

Our most capable model for cybersecurity and biology research, available through trusted access programs

"claude-sonnet-5"

Efficient model for coding and agents

"claude-fable-5"

Next generation of intelligence for the hardest knowledge work and coding problems

"claude-mythos-5"

Most capable model for cybersecurity and biology research

"claude-opus-5"

Powerful intelligence for long-running agents and coding

"claude-opus-4-8"

Powerful intelligence for long-running agents and coding

"claude-opus-4-7"

Powerful intelligence for long-running agents and coding

"claude-opus-4-6"

Powerful intelligence for long-running agents and coding

"claude-sonnet-4-6"

Best combination of speed and intelligence

"claude-haiku-4-5"
"claude-haiku-4-5-20251001"
"claude-opus-4-5"

Powerful intelligence for long-running agents and coding

"claude-opus-4-5-20251101"

Powerful intelligence for long-running agents and coding

"claude-mythos-preview"⁠Deprecated

New class of intelligence, strongest in coding and cybersecurity

Will reach end-of-life on June 30, 2026. Please migrate to claude-mythos-5. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.
"claude-sonnet-4-5"⁠Deprecated

High-performance model for agents and coding

Will reach end-of-life on November 30, 2026. Please migrate to claude-sonnet-5-5. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.
"claude-sonnet-4-5-20250929"⁠Deprecated

High-performance model for agents and coding

Will reach end-of-life on November 30, 2026. Please migrate to claude-sonnet-5-5. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.
string
class OutputConfig { $effort; $format; }
?Effort effort

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.

?JSONOutputFormat format

A schema to specify Claude's output format in responses. See structured outputs

class OutputTokensDetails { $thinkingTokens; }
int thinkingTokens

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; $mediaType; }
"text" type
string data
"text/plain" mediaType
One of the following:
class RawContentBlockDeltaEvent { $type = 'content_block_delta'; $delta; $index; }
"content_block_delta" type
int index
class RawContentBlockStartEvent { $type = 'content_block_start'; $contentBlock; $index; }
"content_block_start" type
ContentBlock contentBlock
int index
class RawContentBlockStopEvent { $type = 'content_block_stop'; $index; }
"content_block_stop" type
int index
class RawMessageDeltaEvent { $type = 'message_delta'; $delta; $usage; }
"message_delta" type
Delta delta

Billing and rate-limit usage.

Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.

Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.

For example, output_tokens will be non-zero, even for an empty string response from Claude.

Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.

class RawMessageStartEvent { $type = 'message_start'; $message; }
"message_start" type
Message message
class RawMessageStopEvent { $type = 'message_stop'; }
"message_stop" type
One of the following:
class RedactedThinkingBlock { $type = 'redacted_thinking'; $data; }
"redacted_thinking" type
string data

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; }
"redacted_thinking" type
string 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; $explanation; }
"refusal" type
?Category category

The policy category that triggered the refusal.

null when the refusal doesn't map to a named category.

?string explanation

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 */ }
"search_result" type
list<TextBlockParam> content
string source
string title
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?CitationsConfigParam citations
class ServerToolCaller { $type = 'code_execution_20250825'; $toolID; }
"code_execution_20250825" type
string toolID
class ServerToolCaller20260120 { $type = 'code_execution_20260120'; $toolID; }
"code_execution_20260120" type
string toolID
class ServerToolUsage { $webFetchRequests; $webSearchRequests; }
int webFetchRequests

The number of web fetch tool requests.

int webSearchRequests

The number of web search tool requests.

class ServerToolUseBlock { $type = 'server_tool_use'; $id; $caller; /* 2 more */ }
"server_tool_use" type
string id
Caller caller
array<string,mixed> input
Name name
class ServerToolUseBlockParam { $type = 'server_tool_use'; $id; $input; /* 3 more */ }
"server_tool_use" type
string id
array<string,mixed> input
Name name
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?Caller caller
class SignatureDelta { $type = 'signature_delta'; $signature; }
"signature_delta" type
string signature

The signature for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a signature_delta event just before the block's content_block_stop event.

class SkillParams { $type; $skillID; $version; }
Type type

Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

string skillID

Skill ID

?string version

Skill version or 'latest' for most recent version

enum StopReason
One of the following:
"end_turn"
"max_tokens"
"stop_sequence"
"tool_use"
"pause_turn"
"refusal"
"model_context_window_exceeded"
class SystemMessageParam { $content; $role; }
Content content
"system" role
class TextBlock { $type = 'text'; $citations; $text; }
"text" type
?list<TextCitation> citations

Citations supporting the text block.

The type of citation returned will depend on the type of document being cited. Citing a PDF results in page_location, plain text results in char_location, and content document results in content_block_location.

string text
class TextBlockParam { $type = 'text'; $text; $cacheControl; $citations; }
"text" type
string text
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?list<TextCitationParam> citations
class TextCitation
One of the following:
One of the following:
class TextDelta { $type = 'text_delta'; $text; }
"text_delta" type
string text
class TextEditorCodeExecutionCreateResultBlock { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
"text_editor_code_execution_create_result" type
bool isFileUpdate
class TextEditorCodeExecutionCreateResultBlockParam { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
"text_editor_code_execution_create_result" type
bool isFileUpdate
class TextEditorCodeExecutionStrReplaceResultBlock { $type = 'text_editor_code_execution_str_replace_result'; $lines; $newLines; /* 3 more */ }
"text_editor_code_execution_str_replace_result" type
?list<string> lines
?int newLines
?int newStart
?int oldLines
?int oldStart
class TextEditorCodeExecutionStrReplaceResultBlockParam { $type = 'text_editor_code_execution_str_replace_result'; $lines; $newLines; /* 3 more */ }
"text_editor_code_execution_str_replace_result" type
?list<string> lines
?int newLines
?int newStart
?int oldLines
?int oldStart
class TextEditorCodeExecutionToolResultBlock { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; }
"text_editor_code_execution_tool_result" type
Content content
string toolUseID
class TextEditorCodeExecutionToolResultBlockParam { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
"text_editor_code_execution_tool_result" type
Content content
string toolUseID
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class TextEditorCodeExecutionToolResultError { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
"text_editor_code_execution_tool_result_error" type
?string errorMessage
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"file_not_found"
class TextEditorCodeExecutionToolResultErrorParam { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
"text_editor_code_execution_tool_result_error" type
?string errorMessage
class TextEditorCodeExecutionViewResultBlock { $type = 'text_editor_code_execution_view_result'; $content; $fileType; /* 3 more */ }
"text_editor_code_execution_view_result" type
string content
FileType fileType
?int numLines
?int startLine
?int totalLines
class TextEditorCodeExecutionViewResultBlockParam { $type = 'text_editor_code_execution_view_result'; $content; $fileType; /* 3 more */ }
"text_editor_code_execution_view_result" type
string content
FileType fileType
?int numLines
?int startLine
?int totalLines
class ThinkingBlock { $type = 'thinking'; $signature; $thinking; }
"thinking" type
string signature

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.

string thinking

The text of Claude's thinking process for this block.

class ThinkingBlockParam { $type = 'thinking'; $signature; $thinking; }
"thinking" type
string signature

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.

string thinking

The thinking text of this block as returned by the API.

class ThinkingConfigAdaptive { $type = 'adaptive'; $display; }
"adaptive" type
?Display 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 ThinkingConfigBetweenTools { $type = 'between_tools'; }
"between_tools" type
class ThinkingConfigDisabled { $type = 'disabled'; }
"disabled" type
class ThinkingConfigEnabled { $type = 'enabled'; $budgetTokens; $display; }
"enabled" type
int budgetTokens

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 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.

One of the following:
class ThinkingDelta { $type = 'thinking_delta'; $thinking; }
"thinking_delta" type
string thinking

The incremental thinking text for this content block. Concatenate the thinking values of successive thinking_delta events to assemble the block's full thinking value.

class Tool { $type; $inputSchema; $name; /* 7 more */ }
?Type type
InputSchema inputSchema

JSON schema for this tool's input.

This defines the shape of the input that your tool accepts and that the model will produce.

string name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?string description

Description of what this tool does.

Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.

?bool eagerInputStreaming

Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.

?list<array<string,mixed>> inputExamples
?bool strict

When true, guarantees schema validation on tool names and inputs

class ToolBash20250124 { $type = 'bash_20250124'; $name; $allowedCallers; /* 4 more */ }
"bash_20250124" type
"bash" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?list<array<string,mixed>> inputExamples
?bool strict

When true, guarantees schema validation on tool names and inputs

class ToolChoice
One of the following:
class ToolChoiceAny { $type = 'any'; $disableParallelToolUse; }
"any" type
?bool disableParallelToolUse

Whether to disable parallel tool use.

Defaults to false. If set to true, the model will output exactly one tool use.

class ToolChoiceAuto { $type = 'auto'; $disableParallelToolUse; }
"auto" type
?bool disableParallelToolUse

Whether to disable parallel tool use.

Defaults to false. If set to true, the model will output at most one tool use.

class ToolChoiceNone { $type = 'none'; }
"none" type
class ToolChoiceTool { $type = 'tool'; $name; $disableParallelToolUse; }
"tool" type
string name

The name of the tool to use.

?bool disableParallelToolUse

Whether to disable parallel tool use.

Defaults to false. If set to true, the model will output exactly one tool use.

class ToolReferenceBlock { $type = 'tool_reference'; $toolName; }
"tool_reference" type
string toolName
class ToolReferenceBlockParam { $type = 'tool_reference'; $toolName; $cacheControl; }
"tool_reference" type
string toolName
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class ToolResultBlockParam { $type = 'tool_result'; $toolUseID; $cacheControl; /* 3 more */ }
"tool_result" type
string toolUseID
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?Content content
?bool isError
?string toolsetName

For a toolset member tool_result, the toolset family of the paired tool_use.

class ToolSearchToolBm25_20251119 { $type; $name; $allowedCallers; /* 3 more */ }
Type type
"tool_search_tool_bm25" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?bool strict

When true, guarantees schema validation on tool names and inputs

class ToolSearchToolRegex20251119 { $type; $name; $allowedCallers; /* 3 more */ }
Type type
"tool_search_tool_regex" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?bool strict

When true, guarantees schema validation on tool names and inputs

class ToolSearchToolResultBlock { $type = 'tool_search_tool_result'; $content; $toolUseID; }
"tool_search_tool_result" type
Content content
string toolUseID
class ToolSearchToolResultBlockParam { $type = 'tool_search_tool_result'; $content; $toolUseID; $cacheControl; }
"tool_search_tool_result" type
Content content
string toolUseID
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class ToolSearchToolResultError { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
"tool_search_tool_result_error" type
?string errorMessage
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
class ToolSearchToolResultErrorParam { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
"tool_search_tool_result_error" type
?string errorMessage
class ToolSearchToolSearchResultBlock { $type = 'tool_search_tool_search_result'; $toolReferences; }
"tool_search_tool_search_result" type
list<ToolReferenceBlock> toolReferences
class ToolSearchToolSearchResultBlockParam { $type = 'tool_search_tool_search_result'; $toolReferences; }
"tool_search_tool_search_result" type
list<ToolReferenceBlockParam> toolReferences
class ToolTextEditor20250124 { $type = 'text_editor_20250124'; $name; $allowedCallers; /* 4 more */ }
"text_editor_20250124" type
"str_replace_editor" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?list<array<string,mixed>> inputExamples
?bool strict

When true, guarantees schema validation on tool names and inputs

class ToolTextEditor20250429 { $type = 'text_editor_20250429'; $name; $allowedCallers; /* 4 more */ }
"text_editor_20250429" type
"str_replace_based_edit_tool" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?list<array<string,mixed>> inputExamples
?bool strict

When true, guarantees schema validation on tool names and inputs

class ToolTextEditor20250728 { $type = 'text_editor_20250728'; $name; $allowedCallers; /* 5 more */ }
"text_editor_20250728" type
"str_replace_based_edit_tool" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?list<array<string,mixed>> inputExamples
?int maxCharacters

Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.

?bool strict

When true, guarantees schema validation on tool names and inputs

class ToolUnion
One of the following:
class ToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
Caller caller
array<string,mixed> input
string name
?string toolsetName

For a toolset member tool_use, the toolset family.

class ToolUseBlockParam { $type = 'tool_use'; $id; $input; /* 4 more */ }
"tool_use" type
string id
array<string,mixed> input
string name
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?Caller caller
?string toolsetName

For a toolset member tool_use, the toolset family this member belongs to.

class ToolUseCaller
One of the following:
class DirectCaller { $type = 'direct'; }
"direct" type
class ServerToolCaller { $type = 'code_execution_20250825'; $toolID; }
"code_execution_20250825" type
string toolID
class ServerToolCaller20260120 { $type = 'code_execution_20260120'; $toolID; }
"code_execution_20260120" type
string toolID
One of the following:
One of the following:
One of the following:
class ToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
"tool_use" type
string id
Caller caller
array<string,mixed> input
string name
?string toolsetName

For a toolset member tool_use, the toolset family.

class URLImageSource { $type = 'url'; $url; }
"url" type
string url
class URLPDFSource { $type = 'url'; $url; }
"url" type
string url
class Usage { $cacheCreation; $cacheCreationInputTokens; $cacheReadInputTokens; /* 7 more */ }
?CacheCreation cacheCreation

Breakdown of cached tokens by TTL

?int cacheCreationInputTokens

The number of input tokens used to create the cache entry.

?int cacheReadInputTokens

The number of input tokens read from the cache.

?string inferenceGeo

The geographic region where inference was performed for this request.

int inputTokens

The number of input tokens which were used.

int outputTokens

The number of output tokens which were used.

?OutputTokensDetails outputTokensDetails

Breakdown of output tokens by category.

output_tokens remains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you.

?ServerToolUsage serverToolUse

The number of server tool requests.

?ServiceTier serviceTier

If the request used the priority, standard, or batch tier.

?Speed speed

The inference speed mode used for this request.

class UserLocation { $type = 'approximate'; $city; $country; /* 2 more */ }
"approximate" type
?string city

The city of the user.

?string country

The two letter ISO country code of the user.

?string region

The region of the user.

?string timezone

The IANA timezone of the user.

class UserMessageParam { $content; $role; }
"user" role
class WebFetchBlock { $type = 'web_fetch_result'; $content; $retrievedAt; $url; }
"web_fetch_result" type
DocumentBlock content
?string retrievedAt

ISO 8601 timestamp when the content was retrieved

string url

Fetched content URL

class WebFetchBlockParam { $type = 'web_fetch_result'; $content; $url; $retrievedAt; }
"web_fetch_result" type
string url

Fetched content URL

?string retrievedAt

ISO 8601 timestamp when the content was retrieved

class WebFetchTool20250910 { $type = 'web_fetch_20250910'; $name; $allowedCallers; /* 9 more */ }
class WebFetchTool20260209 { $type = 'web_fetch_20260209'; $name; $allowedCallers; /* 9 more */ }
class WebFetchTool20260309 { $type = 'web_fetch_20260309'; $name; $allowedCallers; /* 10 more */ }
class WebFetchTool20260318 { $type = 'web_fetch_20260318'; $name; $allowedCallers; /* 11 more */ }
class WebFetchToolResultBlock { $type = 'web_fetch_tool_result'; $caller; $content; $toolUseID; }
"web_fetch_tool_result" type
Caller caller
Content content
string toolUseID
class WebFetchToolResultBlockParam { $type = 'web_fetch_tool_result'; $content; $toolUseID; /* 2 more */ }
"web_fetch_tool_result" type
Content content
string toolUseID
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?Caller caller
class WebFetchToolResultErrorBlock { $type = 'web_fetch_tool_result_error'; $errorCode; }
"web_fetch_tool_result_error" type
class WebFetchToolResultErrorBlockParam { $type = 'web_fetch_tool_result_error'; $errorCode; }
"web_fetch_tool_result_error" type
One of the following:
"invalid_tool_input"
"url_too_long"
"url_not_allowed"
"url_not_in_prior_context"
"url_not_accessible"
"unsupported_content_type"
"too_many_requests"
"max_uses_exceeded"
"unavailable"
"content_too_large"
class WebFetchURLSourceAll { $type = 'all'; }
"all" type
class WebFetchURLSourceExcept { $type = 'except'; $tools; }
"except" type
class WebFetchURLSourceNone { $type = 'none'; }
"none" type
class WebFetchURLSourceOnly { $type = 'only'; $tools; }
"only" type
class WebFetchURLSourceToolReference { $type = 'tool_reference'; $name; }
"tool_reference" type
string name
class WebFetchURLSources { $clientToolResults; $serverToolResults; $userInput; }
?ClientToolResults clientToolResults

Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].

?ServerToolResults serverToolResults

Which server tools' results contribute fetchable URLs: "all", "none", or an only or except list of server tool names from tools[]; only web_search and web_fetch results ever contribute.

?UserInput userInput

Whether URLs in user messages are fetchable: "all" or "none".

class WebSearchResultBlock { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
"web_search_result" type
string encryptedContent
?string pageAge
string title
string url
class WebSearchResultBlockParam { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
"web_search_result" type
string encryptedContent
string title
string url
?string pageAge
class WebSearchTool20250305 { $type = 'web_search_20250305'; $name; $allowedCallers; /* 7 more */ }
"web_search_20250305" type
"web_search" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?list<string> allowedDomains

If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.

?list<string> blockedDomains

If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.

?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?int maxUses

Maximum number of times the tool can be used in the API request.

?bool strict

When true, guarantees schema validation on tool names and inputs

?UserLocation userLocation

Parameters for the user's location. Used to provide more relevant search results.

class WebSearchTool20260209 { $type = 'web_search_20260209'; $name; $allowedCallers; /* 7 more */ }
"web_search_20260209" type
"web_search" name

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

?list<AllowedCaller> allowedCallers
?list<string> allowedDomains

If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.

?list<string> blockedDomains

If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.

?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?bool deferLoading

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

?int maxUses

Maximum number of times the tool can be used in the API request.

?bool strict

When true, guarantees schema validation on tool names and inputs

?UserLocation userLocation

Parameters for the user's location. Used to provide more relevant search results.

class WebSearchTool20260318 { $type = 'web_search_20260318'; $name; $allowedCallers; /* 8 more */ }
class WebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
"web_search_tool_result_error" type
class WebSearchToolResultBlock { $type = 'web_search_tool_result'; $caller; $content; $toolUseID; }
"web_search_tool_result" type
Caller caller
string toolUseID
One of the following:
class WebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
"web_search_tool_result_error" type
class list<WebSearchResultBlock> { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
"web_search_result" type
string encryptedContent
?string pageAge
string title
string url
class WebSearchToolResultBlockParam { $type = 'web_search_tool_result'; $content; $toolUseID; /* 2 more */ }
"web_search_tool_result" type
string toolUseID
?CacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?Caller caller
One of the following:
class list<WebSearchResultBlockParam> { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
"web_search_result" type
string encryptedContent
string title
string url
?string pageAge
class WebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
"web_search_tool_result_error" type
class WebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
"web_search_tool_result_error" type
One of the following:
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"

СообщенияПакеты

Создать пакет сообщений
$client->messages->batches->create(list<Request> requests, ?string userProfileID, ?string workspaceID): MessageBatch
POST/v1/messages/batches

Отправьте пакет запросов на создание сообщений.

Получить пакет сообщений
$client->messages->batches->retrieve(string messageBatchID, ?string workspaceID): MessageBatch
GET/v1/messages/batches/{message_batch_id}

Эта конечная точка идемпотентна и может использоваться для опроса завершения пакета сообщений. Чтобы получить доступ к результатам пакета сообщений, выполните запрос по адресу, указанному в поле results_url ответа.

Список пакетов сообщений
$client->messages->batches->list(?string afterID, ?string beforeID, ?int limit, ?string workspaceID): Page<MessageBatch>
GET/v1/messages/batches

Получите список всех пакетов сообщений в рабочем пространстве. Последние созданные пакеты возвращаются первыми.

Отменить пакет сообщений
$client->messages->batches->cancel(string messageBatchID, ?string workspaceID): MessageBatch
POST/v1/messages/batches/{message_batch_id}/cancel

Пакеты можно отменить в любой момент до окончания обработки. После инициирования отмены пакет переходит в состояние canceling, в котором система может завершить все выполняющиеся непрерываемые запросы перед окончательной отменой.

Удалить пакет сообщений
$client->messages->batches->delete(string messageBatchID, ?string workspaceID): DeletedMessageBatch
DELETE/v1/messages/batches/{message_batch_id}

Удалите пакет сообщений.

Получить результаты пакета сообщений
$client->messages->batches->resultsStream(string messageBatchID, ?string workspaceID): BaseStream<MessageBatchIndividualResponse>
GET/v1/messages/batches/{message_batch_id}/results

Передаёт результаты пакета сообщений в потоковом режиме в виде файла .jsonl.