Claude Platform Docs

Nachrichten

Eine Nachricht erstellen
$client->beta->messages->create(int maxTokens, list<BetaMessageParam> messages, Model model, ?BetaCacheControlEphemeral cacheControl, ?BetaCompactionConfig compaction, ?Container container, ?BetaContextManagementConfig contextManagement, ?BetaDiagnosticsParam diagnostics, ?FallbackCreditToken fallbackCreditToken, ?BetaFallbacksParam fallbacks, ?string inferenceGeo, ?list<BetaRequestMCPServerURLDefinition> mcpServers, ?BetaMetadata metadata, ?BetaOutputConfig outputConfig, ?BetaJSONOutputFormat outputFormat, ?ServiceTier serviceTier, ?Speed speed, ?list<string> stopSequences, ?System system, ?BetaThinkingConfigParam thinking, ?BetaMessageThreadParam thread, ?BetaToolChoice toolChoice, ?list<BetaToolUnion> tools, ?list<AnthropicBeta> betas, ?string userProfileID, ?string workspaceID): BetaMessage
POST/v1/messages

Sende eine strukturierte Liste von Eingabenachrichten mit Text- und/oder Bildinhalten, und das Modell generiert die nächste Nachricht in der Konversation.

Tokens in einer Nachricht zählen
$client->beta->messages->countTokens(list<BetaMessageParam> messages, Model model, ?BetaCacheControlEphemeral cacheControl, ?BetaCompactionConfig compaction, ?BetaContextManagementConfig contextManagement, ?list<BetaRequestMCPServerURLDefinition> mcpServers, ?BetaOutputConfig outputConfig, ?BetaJSONOutputFormat outputFormat, ?Speed speed, ?System system, ?BetaThinkingConfigParam thinking, ?BetaToolChoice toolChoice, ?list<Tool> tools, ?list<AnthropicBeta> betas, ?string userProfileID, ?string workspaceID): BetaMessageTokensCount
POST/v1/messages/count_tokens

Zähle die Anzahl der Tokens in einer Nachricht.

Models
class BetaAdvisorMessageIterationUsage { $type = 'advisor_message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
"advisor_message" type

Usage for an advisor sub-inference iteration

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

int inputTokens

The number of input tokens which were used.

Model model

The model that will complete your prompt.

See models for additional details and options.

int outputTokens

The number of output tokens which were used.

class BetaAdvisorRedactedResultBlock { $type = 'advisor_redacted_result'; $encryptedContent; $stopReason; }
"advisor_redacted_result" type
string encryptedContent

Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.

?string stopReason

The advisor sub-inference's stop reason (same values as the top-level message stop_reason).

class BetaAdvisorRedactedResultBlockParam { $type = 'advisor_redacted_result'; $encryptedContent; $stopReason; }
"advisor_redacted_result" type
string encryptedContent

Opaque blob produced by a prior response; must be round-tripped verbatim.

?string stopReason
class BetaAdvisorResultBlock { $type = 'advisor_result'; $stopReason; $text; }
"advisor_result" type
?string stopReason

The advisor sub-inference's stop reason (same values as the top-level message stop_reason). max_tokens indicates the advisor's output was truncated at the tool's max_tokens value or the advisor model's policy cap.

string text
class BetaAdvisorResultBlockParam { $type = 'advisor_result'; $text; $stopReason; }
"advisor_result" type
string text
?string stopReason
class BetaAdvisorTool20260301 { $type = 'advisor_20260301'; $model; $name; /* 7 more */ }
class BetaAdvisorToolResultBlock { $type = 'advisor_tool_result'; $content; $toolUseID; }
"advisor_tool_result" type
Content content
string toolUseID
class BetaAdvisorToolResultBlockParam { $type = 'advisor_tool_result'; $content; $toolUseID; $cacheControl; }
"advisor_tool_result" type
Content content
string toolUseID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaAdvisorToolResultError { $type = 'advisor_tool_result_error'; $errorCode; }
"advisor_tool_result_error" type
ErrorCode errorCode
class BetaAdvisorToolResultErrorParam { $type = 'advisor_tool_result_error'; $errorCode; }
"advisor_tool_result_error" type
ErrorCode errorCode
class BetaAllThinkingTurns { $type = 'all'; }
"all" type
class BetaAssistantMessageParam { $content; $role; }
"assistant" role
class BetaBase64ImageSource { $type = 'base64'; $data; $mediaType; }
"base64" type
string data
MediaType mediaType
class BetaBase64PDFSource { $type = 'base64'; $data; $mediaType; }
"base64" type
string data
"application/pdf" mediaType
class BetaBashCodeExecutionOutputBlock { $type = 'bash_code_execution_output'; $fileID; }
"bash_code_execution_output" type
string fileID
class BetaBashCodeExecutionOutputBlockParam { $type = 'bash_code_execution_output'; $fileID; }
"bash_code_execution_output" type
string fileID
class BetaBashCodeExecutionResultBlock { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
"bash_code_execution_result" type
int returnCode
string stderr
string stdout
class BetaBashCodeExecutionResultBlockParam { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
"bash_code_execution_result" type
int returnCode
string stderr
string stdout
class BetaBashCodeExecutionToolResultBlock { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; }
"bash_code_execution_tool_result" type
Content content
string toolUseID
class BetaBashCodeExecutionToolResultBlockParam { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
"bash_code_execution_tool_result" type
Content content
string toolUseID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaBashCodeExecutionToolResultError { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
"bash_code_execution_tool_result_error" type
ErrorCode errorCode
class BetaBashCodeExecutionToolResultErrorParam { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
"bash_code_execution_tool_result_error" type
ErrorCode errorCode
One of the following:
class BetaBrowserCoordinateTarget { $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 BetaBrowserRefTarget { $type = 'ref'; $ref; }
"ref" type
string ref

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

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

The tab to close.

class BetaBrowserCloseTabToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Close the tab with the given tab_id.

"close_tab" name
"browser" toolsetName

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

class BetaBrowserCoordinateTarget { $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 BetaBrowserDoubleClickConfig { $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 BetaBrowserDoubleClickInput { $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 BetaBrowserDoubleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"double_click" name
"browser" toolsetName

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

class BetaBrowserFileUploadConfig { $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 BetaBrowserFileUploadInput { $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 BetaBrowserFileUploadToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaBrowserFindConfig { $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 BetaBrowserFindInput { $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 BetaBrowserFindToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaBrowserFormInputConfig { $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 BetaBrowserFormInputInput { $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 BetaBrowserFormInputToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

One of the following:
string
float
bool
class BetaBrowserGetPageTextConfig { $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 BetaBrowserGetPageTextInput { $tabID; }
?string tabID

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

class BetaBrowserGetPageTextToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaBrowserHoldKeyConfig { $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 BetaBrowserHoldKeyInput { $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 BetaBrowserHoldKeyToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaBrowserHoverConfig { $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 BetaBrowserHoverInput { $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 BetaBrowserHoverToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Move the cursor to a coordinate or element without clicking.

"hover" name
"browser" toolsetName

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

class BetaBrowserJavascriptExecConfig { $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 BetaBrowserJavascriptExecInput { $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 BetaBrowserJavascriptExecToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaBrowserKeyConfig { $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 BetaBrowserKeyInput { $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 BetaBrowserKeyToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaBrowserLeftClickConfig { $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 BetaBrowserLeftClickDragConfig { $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 BetaBrowserLeftClickDragInput { $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 BetaBrowserLeftClickDragToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"left_click_drag" name
"browser" toolsetName

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

class BetaBrowserLeftClickInput { $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 BetaBrowserLeftClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"left_click" name
"browser" toolsetName

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

class BetaBrowserLeftMouseDownConfig { $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 BetaBrowserLeftMouseDownInput { $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 BetaBrowserLeftMouseDownToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaBrowserLeftMouseUpConfig { $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 BetaBrowserLeftMouseUpInput { $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 BetaBrowserLeftMouseUpToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Release the left mouse button at a viewport coordinate.

"left_mouse_up" name
"browser" toolsetName

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

class BetaBrowserListTabsConfig { $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 BetaBrowserListTabsToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"list_tabs" name
"browser" toolsetName

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

class BetaBrowserMiddleClickConfig { $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 BetaBrowserMiddleClickInput { $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 BetaBrowserMiddleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"middle_click" name
"browser" toolsetName

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

class BetaBrowserMouseMoveConfig { $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 BetaBrowserMouseMoveInput { $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 BetaBrowserMouseMoveToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Move the pointer to a viewport coordinate without clicking.

"mouse_move" name
"browser" toolsetName

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

class BetaBrowserNavigateConfig { $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 BetaBrowserNavigateInput { $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 BetaBrowserNavigateToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"navigate" name
"browser" toolsetName

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

class BetaBrowserNewTabConfig { $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 BetaBrowserNewTabToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Open a new empty tab and return its tab_id.

"new_tab" name
"browser" toolsetName

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

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

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

class BetaBrowserReadConsoleToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

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

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

class BetaBrowserReadNetworkToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaBrowserReadPageConfig { $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 BetaBrowserReadPageInput { $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 BetaBrowserReadPageToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

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

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

class BetaBrowserRightClickConfig { $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 BetaBrowserRightClickInput { $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 BetaBrowserRightClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"right_click" name
"browser" toolsetName

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

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

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

class BetaBrowserScreenshotToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Capture the current browser viewport.

"screenshot" name
"browser" toolsetName

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

class BetaBrowserScrollConfig { $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 BetaBrowserScrollInput { $scrollDirection; $target; $scrollAmount; $tabID; }
BetaBrowserScrollDirection 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 BetaBrowserScrollToConfig { $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 BetaBrowserScrollToInput { $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 BetaBrowserScrollToToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Scroll an element into view.

"scroll_to" name
"browser" toolsetName

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

class BetaBrowserScrollToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"scroll" name
"browser" toolsetName

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

class BetaBrowserStateBlockParam { $type = 'browser_state'; $tabs; $cacheControl; $stateChanges; }
"browser_state" type

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.

?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?list<BetaBrowserStateChange> 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 BetaBrowserStateChangeDownloadCompleted { $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 BetaBrowserStateChangeDownloadFailed { $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 BetaBrowserStateChangeDownloadStarted { $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 BetaBrowserStateChangeTabOpened { $type = 'tab_opened'; $tabID; }
"tab_opened" type
string tabID

The tab_id of the opened tab, present in tabs.

class BetaBrowserStateTabEntry { $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 BetaBrowserSwitchTabConfig { $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 BetaBrowserSwitchTabInput { $tabID; }
string tabID

The tab to switch to.

class BetaBrowserSwitchTabToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

One of the following:
class BetaBrowserToolset20260801 { $type = 'browser_toolset_20260801'; $cacheControl; $configs; }
"browser_toolset_20260801" type
?BetaCacheControlEphemeral 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 BetaBrowserToolsetConfigs { $type; $closeTab; $doubleClick; /* 28 more */ }
class BetaBrowserTripleClickConfig { $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 BetaBrowserTripleClickInput { $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 BetaBrowserTripleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"triple_click" name
"browser" toolsetName

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

class BetaBrowserTypeConfig { $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 BetaBrowserTypeInput { $text; $tabID; }
string text

The text to type.

?string tabID

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

class BetaBrowserTypeToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Type a literal string at the current focus.

"type" name
"browser" toolsetName

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

class BetaBrowserWaitConfig { $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 BetaBrowserWaitInput { $duration; $tabID; }
float duration

Seconds to wait (maximum 30).

?string tabID

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

class BetaBrowserWaitToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Pause for the given duration.

"wait" name
"browser" toolsetName

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

class BetaBrowserZoomConfig { $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 BetaBrowserZoomInput { $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 BetaBrowserZoomToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaCacheControlEphemeral { $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 BetaCacheCreation { $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 BetaCacheMissMessagesChanged { $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 BetaCacheMissModelChanged { $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 BetaCacheMissPreviousMessageNotFound { $type = 'previous_message_not_found'; }
"previous_message_not_found" type
One of the following:
class BetaCacheMissSystemChanged { $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 BetaCacheMissToolsChanged { $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 BetaCacheMissUnavailable { $type = 'unavailable'; }
"unavailable" type
class BetaCitationCharLocation { $type = 'char_location'; $citedText; $documentIndex; /* 4 more */ }
"char_location" type
string citedText
int documentIndex
?string documentTitle
int endCharIndex
?string fileID
int startCharIndex
class BetaCitationCharLocationParam { $type = 'char_location'; $citedText; $documentIndex; /* 3 more */ }
"char_location" type
string citedText
int documentIndex
?string documentTitle
int endCharIndex
int startCharIndex
class BetaCitationConfig { $enabled; }
bool enabled
class BetaCitationContentBlockLocation { $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 BetaCitationContentBlockLocationParam { $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 BetaCitationPageLocation { $type = 'page_location'; $citedText; $documentIndex; /* 4 more */ }
"page_location" type
string citedText
int documentIndex
?string documentTitle
int endPageNumber
?string fileID
int startPageNumber
class BetaCitationPageLocationParam { $type = 'page_location'; $citedText; $documentIndex; /* 3 more */ }
"page_location" type
string citedText
int documentIndex
?string documentTitle
int endPageNumber
int startPageNumber
class BetaCitationSearchResultLocation { $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 BetaCitationSearchResultLocationParam { $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 BetaCitationWebSearchResultLocationParam { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
"web_search_result_location" type
string citedText
string encryptedIndex
?string title
string url
class BetaCitationsConfigParam { $enabled; }
?bool enabled
class BetaCitationsDelta { $type = 'citations_delta'; $citation; }
"citations_delta" type
Citation citation
class BetaCitationsWebSearchResultLocation { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
"web_search_result_location" type
string citedText
string encryptedIndex
?string title
string url
class BetaClearThinking20251015Edit { $type = 'clear_thinking_20251015'; $keep; }
"clear_thinking_20251015" type
?Keep keep

Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.

class BetaClearThinking20251015EditResponse { $type = 'clear_thinking_20251015'; $clearedInputTokens; $clearedThinkingTurns; }
"clear_thinking_20251015" type

The type of context management edit applied.

int clearedInputTokens

Number of input tokens cleared by this edit.

int clearedThinkingTurns

Number of thinking turns that were cleared.

class BetaClearToolUses20250919Edit { $type = 'clear_tool_uses_20250919'; $clearAtLeast; $clearToolInputs; /* 3 more */ }
"clear_tool_uses_20250919" type

Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.

?ClearToolInputs clearToolInputs

Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)

?list<string> excludeTools

Tool names whose uses are preserved from clearing

Number of tool uses to retain in the conversation

?Trigger trigger

Condition that triggers the context management strategy

class BetaClearToolUses20250919EditResponse { $type = 'clear_tool_uses_20250919'; $clearedInputTokens; $clearedToolUses; }
"clear_tool_uses_20250919" type

The type of context management edit applied.

int clearedInputTokens

Number of input tokens cleared by this edit.

int clearedToolUses

Number of tool uses that were cleared.

class BetaCodeExecutionOutputBlock { $type = 'code_execution_output'; $fileID; }
"code_execution_output" type
string fileID
class BetaCodeExecutionOutputBlockParam { $type = 'code_execution_output'; $fileID; }
"code_execution_output" type
string fileID
class BetaCodeExecutionResultBlock { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
"code_execution_result" type
int returnCode
string stderr
string stdout
class BetaCodeExecutionResultBlockParam { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
"code_execution_result" type
int returnCode
string stderr
string stdout
class BetaCodeExecutionTool20250522 { $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
?BetaCacheControlEphemeral 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 BetaCodeExecutionTool20250825 { $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
?BetaCacheControlEphemeral 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 BetaCodeExecutionTool20260120 { $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
?BetaCacheControlEphemeral 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 BetaCodeExecutionTool20260521 { $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
?BetaCacheControlEphemeral 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 BetaCodeExecutionToolResultBlock { $type = 'code_execution_tool_result'; $content; $toolUseID; }
"code_execution_tool_result" type
string toolUseID
One of the following:
class BetaCodeExecutionToolResultBlockParam { $type = 'code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
"code_execution_tool_result" type
string toolUseID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

One of the following:
class BetaCodeExecutionToolResultError { $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 BetaCodeExecutionToolResultErrorParam { $type = 'code_execution_tool_result_error'; $errorCode; }
"code_execution_tool_result_error" type
class BetaCompact20260112Edit { $type = 'compact_20260112'; $instructions; $pauseAfterCompaction; $trigger; }
"compact_20260112" type
?string instructions

Additional instructions for summarization.

?bool pauseAfterCompaction

Whether to pause after compaction and return the compaction block to the user.

When to trigger compaction. Defaults to 150000 input tokens.

class BetaCompactionBlock { $type = 'compaction'; $content; $encryptedContent; /* 2 more */ }
"compaction" type
?string content

Summary of compacted content, or null if compaction failed

?string encryptedContent⁠

Opaque metadata from prior compaction, to be round-tripped verbatim

?string signature⁠

Signature over the summary, to be sent back with the block verbatim

?list<ToolChange> toolChanges⁠

The tool changes of the compacted range: the tool_addition and tool_removal blocks that take the request's tools to the tool set in effect at the end of the range, or [] when the range changed no tool. Absent when the server did not compute them. Send the block back unchanged.

class BetaCompactionBlockParam { $type = 'compaction'; $cacheControl; $content; /* 3 more */ }
"compaction" type
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?string content

Summary of previously compacted content, or null if compaction failed

?string encryptedContent⁠

Opaque metadata from prior compaction, to be round-tripped verbatim

?string signature⁠

The block's signature as returned, to be sent back verbatim

?list<ToolChange> toolChanges⁠

The tool changes of the compacted range, as the server returned them on this block: the tool_addition and tool_removal entries that take the request's tools to the tool set in effect at the end of the range. Send them back unchanged with the block.

class BetaCompactionConfig { $type = 'summarize'; $instructions; }
"summarize" type
?string instructions

Replaces the server's default summarization prompt for this request. An empty or whitespace-only value counts as absent.

class BetaCompactionContentBlockDelta { $type = 'compaction_delta'; $content; $encryptedContent; }
"compaction_delta" type
?string content
?string encryptedContent⁠

Opaque metadata from prior compaction, to be round-tripped verbatim

class BetaCompactionIterationUsage { $type = 'compaction'; $cacheCreation; $cacheCreationInputTokens; /* 3 more */ }
"compaction" type

Usage for a compaction iteration

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

int inputTokens

The number of input tokens which were used.

int outputTokens

The number of output tokens which were used.

class BetaComputerCursorPositionConfig { $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 BetaComputerCursorPositionToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"cursor_position" name
"computer" toolsetName

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

class BetaComputerDoubleClickConfig { $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 BetaComputerDoubleClickInput { $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 BetaComputerDoubleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaComputerHoldKeyConfig { $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 BetaComputerHoldKeyInput { $duration; $text; }
int duration

Duration to hold the key, in seconds.

string text

The key or key-combination to hold.

class BetaComputerHoldKeyToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"hold_key" name
"computer" toolsetName

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

class BetaComputerKeyConfig { $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 BetaComputerKeyInput { $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 BetaComputerKeyToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaComputerLeftClickConfig { $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 BetaComputerLeftClickDragConfig { $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 BetaComputerLeftClickDragInput { $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 BetaComputerLeftClickDragToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Click and drag the cursor from start_coordinate to coordinate.

"left_click_drag" name
"computer" toolsetName

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

class BetaComputerLeftClickInput { $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 BetaComputerLeftClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaComputerLeftMouseDownConfig { $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 BetaComputerLeftMouseDownToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

"left_mouse_down" name
"computer" toolsetName

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

class BetaComputerLeftMouseUpConfig { $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 BetaComputerLeftMouseUpToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Release the left mouse button.

"left_mouse_up" name
"computer" toolsetName

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

class BetaComputerMiddleClickConfig { $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 BetaComputerMiddleClickInput { $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 BetaComputerMiddleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

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

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

class BetaComputerMouseMoveToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaComputerRightClickConfig { $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 BetaComputerRightClickInput { $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 BetaComputerRightClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaComputerScreenshotConfig { $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 BetaComputerScreenshotToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Take a screenshot of the screen.

"screenshot" name
"computer" toolsetName

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

class BetaComputerScrollConfig { $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 BetaComputerScrollInput { $scrollAmount; $scrollDirection; $coordinate; $text; }
int scrollAmount

Number of 'clicks' of the scroll wheel.

BetaComputerScrollDirection 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 BetaComputerScrollToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

One of the following:
class BetaComputerToolset20260801 { $type = 'computer_toolset_20260801'; $cacheControl; $configs; }
"computer_toolset_20260801" type
?BetaCacheControlEphemeral 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 BetaComputerToolsetConfigs { $type; $cursorPosition; $doubleClick; /* 14 more */ }
class BetaComputerTripleClickConfig { $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 BetaComputerTripleClickInput { $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 BetaComputerTripleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

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

The text to type.

class BetaComputerTypeToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Type a string of text on the keyboard.

"type" name
"computer" toolsetName

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

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

Duration to wait, in seconds.

class BetaComputerWaitToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

Wait for a specified duration.

"wait" name
"computer" toolsetName

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

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

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

class BetaComputerZoomToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id

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

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

class BetaContainer { $id; $expiresAt; $skills; }
string id

Identifier for the container used in this request

\Datetime expiresAt

The time at which the container will expire.

?list<BetaContainerSkill> skills

Skills loaded in the container

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

Container id

?list<BetaSkillParams> skills

List of skills to load in the container

class BetaContainerSkill { $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 BetaContainerUploadBlock { $type = 'container_upload'; $fileID; }
"container_upload" type
string fileID
class BetaContainerUploadBlockParam { $type = 'container_upload'; $fileID; $cacheControl; }
"container_upload" type
string fileID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

One of the following:
One of the following:
class BetaContentBlockSource { $type = 'content'; $content; }
"content" type
Content content
One of the following:
class BetaContextManagementConfig { $edits; }
?list<Edit> edits

List of context management edits to apply

class BetaContextManagementResponse { $appliedEdits; }
list<AppliedEdit> appliedEdits

List of context management edits that were applied.

class BetaCountTokensContextManagementResponse { $originalInputTokens; }
int originalInputTokens

The original token count before context management was applied

class BetaDiagnostics { $cacheMissReason; }
?BetaCacheMissReason 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 BetaDiagnosticsParam { $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 BetaDirectCaller { $type = 'direct'; }
"direct" type
class BetaDocumentBlock { $type = 'document'; $citations; $source; $title; }
"document" type
?BetaCitationConfig citations

Citation configuration for the document

Source source
?string title

The title of the document

class BetaEncryptedCodeExecutionResultBlock { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
"encrypted_code_execution_result" type
string encryptedStdout
int returnCode
string stderr
class BetaEncryptedCodeExecutionResultBlockParam { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
"encrypted_code_execution_result" type
string encryptedStdout
int returnCode
string stderr
class BetaFallbackBlock { $type = 'fallback'; $from; $to; $trigger; }
"fallback" type

The model whose output ends at this point — the model that declined at this hop. When the declining hop is the requested model, its model echoes the top-level model string the caller sent (alias or canonical); when the declining hop is a fallback model, its model is that model's canonical id.

The fallback model producing the content that follows this block. Its model is always the canonical id.

What caused the from model to hand over at this hop.

class BetaFallbackBlockParam { $type = 'fallback'; $from; $to; $trigger; }
"fallback" type

Identifies one hop of a fallback transition.

Identifies one hop of a fallback transition.

?mixed trigger

The response block's trigger, echoed verbatim. Accepted and ignored by the server; any object or null is allowed.

class BetaFallbackCreditNotApplied { $type = 'not_applied'; $reason; $removeToRedeem; }
"not_applied" type
Reason reason

Why the reprice was not applied.

A closed enum; additions to the redemption-check vocabulary arrive as deliberate schema updates.

?list<string> removeToRedeem

Request fields to remove before retrying, so the retry can redeem this token.

Present exactly when reason is variant_fields_present — never null, never an empty array; absent otherwise. Fields are named only from your own request, and only after the sealed variant hash matched. A served best-effort retry has already been billed at normal price; nothing redeems retroactively, but a corrected re-send inside the token's five-minute window can still redeem.

class BetaFallbackCreditRedeemed { $type = 'redeemed'; }
"redeemed" type
class BetaFallbackCreditTokenParam { $token; $mode; }
string token

The opaque fallback_credit_token from a prior refusal's stop_details — the same string the bare-string form carries.

?Mode mode

How a failing token affects the retry. strict (the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served. best_effort: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response's usage.fallback_credit. Two failures stay hard in both modes: a malformed token, and combining fallback_credit_token with fallbacks.

class BetaFallbackCreditUsage { $status; }
Status status

Whether the fallback-credit reprice was applied to this response's billing.

A union discriminated on type. redeemed: the retry is billed as if the conversation had been on the retry model all along — including when the resulting shift is zero because there was nothing to move. not_applied: no reprice was applied; the arm's reason says why.

class BetaFallbackInfo { $model; }
Model model

The model that will complete your prompt.

See models for additional details and options.

class BetaFallbackInfoParam { $model; }
Model model

The model that will complete your prompt.

See models for additional details and options.

class BetaFallbackMessageIterationUsage { $type = 'fallback_message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
"fallback_message" type

Usage for the fallback-model attempt that served the response

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

int inputTokens

The number of input tokens which were used.

Model model

The model that will complete your prompt.

See models for additional details and options.

int outputTokens

The number of output tokens which were used.

class BetaFallbackParam { $model; $maxTokens; $outputConfig; /* 2 more */ }
Model model

The model that will complete your prompt.

See models for additional details and options.

?int maxTokens

The max_tokens for the fallback attempt that uses this fallbacks entry's model, in place of the request's max_tokens. If you leave it out or set it to null, the attempt uses the request's max_tokens.

See the refusals and fallback guide to learn more about fallback entries.

?BetaOutputConfig outputConfig

Output parameters for the fallback attempt that uses this fallbacks entry's model, combined with the request's output_config one field at a time.

  • format: If you leave it out, the attempt uses the request's format. If you set it to null, the attempt runs without a format.
  • effort: If you leave it out, the attempt uses the request's effort when model supports that level with the attempt's thinking. If the request doesn't set effort, if model doesn't support the level, or if you set effort to null, the attempt runs at the default effort of model.
  • task_budget: If you leave it out, the attempt uses the request's task_budget when model accepts a task budget of that size. If the request doesn't set task_budget, if model doesn't accept it, or if you set task_budget to null, the attempt runs without a task budget.

Set output_config to null to run the attempt without a format or a task budget, at the default effort of model.

These rules apply with the server-side-fallback-2026-07-01 beta header.

?Speed speed

The inference speed mode for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt runs at fast speed only when the request sets speed to fast and your organization can use fast mode on model.

Otherwise, or when you set this field to null, the attempt runs at standard speed.

These rules apply with the server-side-fallback-2026-07-01 beta header.

?Thinking thinking

The thinking configuration for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt uses the request's thinking when model supports that thinking type.

If you leave it out and the request's thinking type is between_tools but model doesn't support between_tools, the attempt uses disabled if model supports it. Otherwise, if model doesn't support the request's thinking type, if the request doesn't set thinking, or if you set this field to null, the attempt uses the thinking type that model uses when a request leaves out thinking. The request's thinking.display still applies where model allows it.

These rules apply with the server-side-fallback-2026-07-01 beta header.

class BetaFallbackRefusalTrigger { $type = 'refusal'; $category; }
"refusal" type
?Category category

The policy category that triggered the from model's refusal at this hop. null when the refusal doesn't map to a named category. Same vocabulary as stop_details.category.

One of the following:
class list<BetaFallbackParam> { $model; $maxTokens; $outputConfig; /* 2 more */ }
Model model

The model that will complete your prompt.

See models for additional details and options.

?int maxTokens

The max_tokens for the fallback attempt that uses this fallbacks entry's model, in place of the request's max_tokens. If you leave it out or set it to null, the attempt uses the request's max_tokens.

See the refusals and fallback guide to learn more about fallback entries.

?BetaOutputConfig outputConfig

Output parameters for the fallback attempt that uses this fallbacks entry's model, combined with the request's output_config one field at a time.

  • format: If you leave it out, the attempt uses the request's format. If you set it to null, the attempt runs without a format.
  • effort: If you leave it out, the attempt uses the request's effort when model supports that level with the attempt's thinking. If the request doesn't set effort, if model doesn't support the level, or if you set effort to null, the attempt runs at the default effort of model.
  • task_budget: If you leave it out, the attempt uses the request's task_budget when model accepts a task budget of that size. If the request doesn't set task_budget, if model doesn't accept it, or if you set task_budget to null, the attempt runs without a task budget.

Set output_config to null to run the attempt without a format or a task budget, at the default effort of model.

These rules apply with the server-side-fallback-2026-07-01 beta header.

?Speed speed

The inference speed mode for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt runs at fast speed only when the request sets speed to fast and your organization can use fast mode on model.

Otherwise, or when you set this field to null, the attempt runs at standard speed.

These rules apply with the server-side-fallback-2026-07-01 beta header.

?Thinking thinking

The thinking configuration for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt uses the request's thinking when model supports that thinking type.

If you leave it out and the request's thinking type is between_tools but model doesn't support between_tools, the attempt uses disabled if model supports it. Otherwise, if model doesn't support the request's thinking type, if the request doesn't set thinking, or if you set this field to null, the attempt uses the thinking type that model uses when a request leaves out thinking. The request's thinking.display still applies where model allows it.

These rules apply with the server-side-fallback-2026-07-01 beta header.

"default"
class BetaFileDocumentSource { $type = 'file'; $fileID; }
"file" type
string fileID
class BetaFileImageSource { $type = 'file'; $fileID; }
"file" type
string fileID
class BetaImageBlockParam { $type = 'image'; $source; $cacheControl; $transformations; }
"image" type
Source source
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?BetaImageTransformationsParam 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 BetaImageTransformationsParam { $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 BetaInputJSONDelta { $type = 'input_json_delta'; $partialJSON; }
"input_json_delta" type
string partialJSON
class BetaInputTokensClearAtLeast { $type = 'input_tokens'; $value; }
"input_tokens" type
int value
class BetaInputTokensTrigger { $type = 'input_tokens'; $value; }
"input_tokens" type
int value
One of the following:
list<BetaIterationsUsageItem>
One of the following:
class BetaJSONOutputFormat { $type = 'json_schema'; $schema; }
"json_schema" type
array<string,mixed> schema

The JSON schema of the format

class BetaMCPTool { $inputSchema; $name; $description; }
array<string,mixed> inputSchema
string name
?string description
class BetaMCPToolConfig { $deferLoading; $enabled; }
?bool deferLoading
?bool enabled
class BetaMCPToolDefaultConfig { $deferLoading; $enabled; }
?bool deferLoading
?bool enabled
class BetaMCPToolListingBlock { $type = 'mcp_tool_listing'; $mcpServerName; $tools; }
"mcp_tool_listing" type
string mcpServerName
list<BetaMCPTool> tools
class BetaMCPToolListingBlockParam { $type = 'mcp_tool_listing'; $mcpServerName; $tools; }
"mcp_tool_listing" type
string mcpServerName

The name of the MCP server this listing came from, as mcp_servers declares it.

list<BetaMCPToolParam> tools

The server's tools, exactly as the response listed them.

class BetaMCPToolParam { $inputSchema; $name; $description; }
array<string,mixed> inputSchema

The tool's input schema as the MCP server lists it, verbatim.

string name

The tool's name as the MCP server lists it (not prefixed with the server name).

?string description

The tool's description as the MCP server lists it.

class BetaMCPToolResultBlock { $type = 'mcp_tool_result'; $content; $isError; $toolUseID; }
"mcp_tool_result" type
Content content
bool isError
string toolUseID
class BetaMCPToolUseBlock { $type = 'mcp_tool_use'; $id; $input; /* 2 more */ }
"mcp_tool_use" type
string id
array<string,mixed> input
string name

The name of the MCP tool

string serverName

The name of the MCP server

class BetaMCPToolUseBlockParam { $type = 'mcp_tool_use'; $id; $input; /* 3 more */ }
"mcp_tool_use" type
string id
array<string,mixed> input
string name
string serverName

The name of the MCP server

?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaMCPToolset { $type = 'mcp_toolset'; $mcpServerName; $cacheControl; /* 3 more */ }
"mcp_toolset" type
string mcpServerName

Name of the MCP server to configure tools for

?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?array<string,BetaMCPToolConfig> configs

Configuration overrides for specific tools, keyed by tool name

?BetaMCPToolDefaultConfig defaultConfig

Default configuration applied to all tools from this server

?list<BetaMCPToolParam> tools⁠

The server's tool listing, pinned: when present, the server is not asked for its tools before sampling and exactly these entries, with default_config and configs applied, are the toolset's tools. Copy it from the mcp_tool_listing block of an earlier response.

class BetaMemoryTool20250818 { $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
?BetaCacheControlEphemeral 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

One of the following:
class BetaMemoryTool20250818CreateCommand { $command; $fileText; $path; }
"create" command

Command type identifier

string fileText

Content to write to the file

string path

Path where the file should be created

class BetaMemoryTool20250818DeleteCommand { $command; $path; }
"delete" command

Command type identifier

string path

Path to the file or directory to delete

class BetaMemoryTool20250818InsertCommand { $command; $insertLine; $insertText; $path; }
"insert" command

Command type identifier

int insertLine

Line number where text should be inserted

string insertText

Text to insert at the specified line

string path

Path to the file where text should be inserted

class BetaMemoryTool20250818RenameCommand { $command; $newPath; $oldPath; }
"rename" command

Command type identifier

string newPath

New path for the file or directory

string oldPath

Current path of the file or directory

class BetaMemoryTool20250818StrReplaceCommand { $command; $newStr; $oldStr; $path; }
"str_replace" command

Command type identifier

string newStr

Text to replace with

string oldStr

Text to search for and replace

string path

Path to the file where text should be replaced

class BetaMemoryTool20250818ViewCommand { $command; $path; $viewRange; }
"view" command

Command type identifier

string path

Path to directory or file to view

?list<int> viewRange

Optional line range for viewing specific lines

class BetaMessage { $type = 'message'; $id; $container; /* 10 more */ }
One of the following:
class BetaMessageDeltaUsage { $cacheCreationInputTokens; $cacheReadInputTokens; $fallbackCredit; /* 5 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.

?BetaFallbackCreditUsage fallbackCredit⁠

Outcome of the fallback_credit_token presented on this request.

Present on every response to a non-batch request that carried a fallback_credit_token, in either redemption mode; absent otherwise (batch items accept and ignore the token and carry no outcome object).

?int inputTokens

The cumulative number of input tokens which were used.

?list<BetaIterationsUsageItem> iterations⁠

Per-iteration token usage breakdown.

Each entry represents one sampling iteration, with its own input/output token counts and cache statistics, discriminated by type. For message entries (model sampling iterations, such as the turns of a server-side tool use loop), this allows you to:

  • Calculate the context window size from the last message entry
  • Understand token accumulation across server-side tool use loops

A compaction entry reports the token usage of the compaction operation itself — the server-side request that summarizes the context being closed — NOT the size of the context that was compacted away, and its token counts can be much smaller than that closed context (for example, a compaction that closes a ~200k-token context can report only a few thousand tokens). Do not derive the context window size from a compaction entry, even when it is the last entry. A compaction entry's tokens are not included in the top-level usage fields. When an input-token trigger is in effect (the default — 150,000 tokens unless configured otherwise), each compaction entry closes a context that had reached at least that threshold, though the context can exceed it by the final iteration's output and tool results.

int outputTokens

The cumulative number of output tokens which were used.

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

?BetaServerToolUsage serverToolUse

The number of server tool requests.

class BetaMessageIterationUsage { $type = 'message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
"message" type

Usage for a sampling iteration

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

int inputTokens

The number of input tokens which were used.

?Model model

The model that will complete your prompt.

See models for additional details and options.

int outputTokens

The number of output tokens which were used.

One of the following:
One of the following:
class BetaThreadCreateParams { $type = 'create'; }
"create" type
class BetaThreadContinueParams { $type = 'continue'; $previousMessageID; }
"continue" type
string previousMessageID

The id of the previous response in this Thread.

class BetaMessageTokensCount { $contextManagement; $inputTokens; }
?BetaCountTokensContextManagementResponse contextManagement⁠

Information about context management applied to the message.

int inputTokens

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

class BetaMetadata { $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.

class BetaOutputConfig { $effort; $format; $taskBudget; }
?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.

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

?BetaTokenTaskBudget taskBudget⁠

Configuration for token budget tracking across contexts.

class BetaOutputTokensDetails { $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 BetaPlainTextSource { $type = 'text'; $data; $mediaType; }
"text" type
string data
"text/plain" mediaType
One of the following:
class BetaRawContentBlockDeltaEvent { $type = 'content_block_delta'; $delta; $index; }
"content_block_delta" type
int index
class BetaRawContentBlockStartEvent { $type = 'content_block_start'; $contentBlock; $index; }
"content_block_start" type
ContentBlock contentBlock
int index
class BetaRawContentBlockStopEvent { $type = 'content_block_stop'; $index; }
"content_block_stop" type
int index
class BetaRawMessageDeltaEvent { $type = 'message_delta'; $contextManagement; $delta; /* 2 more */ }
"message_delta" type
?BetaContextManagementResponse contextManagement⁠

Information about context management strategies applied during the request

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.

?list<BetaInputTransformation> inputTransformations⁠

Changes the API made to the request's input before showing it to the model, and blocks that failed a binding check but were left unchanged: one entry per block, in request order. Two entry types today. thinking_dropped — a thinking, redacted_thinking or connector_text block from the request's messages that was removed from the prompt instead of being shown to the model because it failed a binding check. thinking_mismatch_allowed — a thinking or redacted_thinking block that failed the conversation check (the conversation before it differs from the one it was created in, or it carries no record of one on a model that requires it) and was shown to the model all the same, because that check is not enforced for this request. More entry types may be added over time; ignore types you do not recognize.

Requires anthropic-beta: thinking-binding-controls-2026-08-01. Present on every such response from a model that supports extended thinking, as [] when there is no entry to report; without the beta, blocks are removed or left in place all the same but nothing is reported. Removed blocks contribute nothing to usage.input_tokens; blocks left in place count as sent. When streaming, the array is final in message_start; the final message_delta event carries it only when a server-side model fallback happened mid-stream, in which case it holds the serving model's entries and replaces the one in message_start.

class BetaRawMessageStartEvent { $type = 'message_start'; $message; }
"message_start" type
BetaMessage message
class BetaRawMessageStopEvent { $type = 'message_stop'; }
"message_stop" type
One of the following:
class BetaRedactedThinkingBlock { $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 BetaRedactedThinkingBlockParam { $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 BetaRefusalStopDetails { $type = 'refusal'; $category; $explanation; /* 3 more */ }
"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.

?string fallbackCreditToken⁠

Opaque code that refunds the cache-miss cost when retrying this refused request on the fallback model. Pass it as fallback_credit_token on the retry request. Expires 5 minutes after the refusal.

The retry is sent either with the same request body (system, messages, tools, and other render-shaping fields), or with the same body plus one appended assistant message whose content is the partial text (with any trailing whitespace stripped from the final text block) and paired server-tool blocks from this refusal — which also authorizes that appended turn as an assistant-prefill continuation on models that otherwise disallow prefill. A token minted mid-server-tool-loop whose partial content was continuable may only be redeemed the second way — if a same-body retry is rejected with a 400 saying the token must be redeemed by continuing the partial response, retry the second way instead. Either way: same workspace, same platform; a mismatch is a 400. Resending a token for an already-warm prefix is permitted but yields no additional credit.

null when the refused model isn't eligible for a fallback credit.

?bool fallbackHasPrefillClaim⁠

Whether the accompanying fallback_credit_token may be redeemed with the appended-assistant retry form. Only set when fallback_credit_token is present.

true: retry by resending the same request body plus one appended assistant message whose content is this response's content with any trailing whitespace stripped from the final text block and unpaired tool_use blocks omitted (the same appended-turn shape described on fallback_credit_token), with the token attached. false: retry by resending the original request body unchanged, with the token attached — the appended-assistant form is not available for this refusal (no continuable partial content, or the request uses output_format or a tool_choice that forces tool use). One exception: when the request used output_format or a forced tool_choice and the refusal arrived after server tools (including MCP connector tools) had already executed, the token may not be redeemable by either retry form; if the exact-body retry is then rejected with a 400 saying the token must be redeemed by continuing the partial response, discard the token and retry without it.

Advisory: if an appended-assistant retry is rejected with a 400 despite true, fall back to resending the original request body with the token.

?string recommendedModel⁠

The server's suggested retry target for this refusal. Populated when a fallback attempt could not be made (the fallback model's rate limit was exhausted, or it was overloaded); names the fallback model the caller can retry directly. Null otherwise.

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

Create a cache control breakpoint at this content block.

?string context
?string title
class BetaRequestMCPServerToolConfiguration { $allowedTools; $enabled; }
?list<string> allowedTools
?bool enabled
class BetaRequestMCPServerURLDefinition { $type = 'url'; $name; $url; /* 2 more */ }
"url" type
string name
string url
?string authorizationToken
class BetaRequestMCPToolResultBlockParam { $type = 'mcp_tool_result'; $toolUseID; $cacheControl; /* 2 more */ }
"mcp_tool_result" type
string toolUseID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?Content content
?bool isError
class BetaRequestToolAdditionBlock { $type = 'tool_addition'; $tool; $cacheControl; }
"tool_addition" type
Tool tool
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaRequestToolRemovalBlock { $type = 'tool_removal'; $tool; $cacheControl; }
"tool_removal" type
Tool tool
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaResponseTool { $type; $inputSchema; $name; /* 6 more */ }
?Type type

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
?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 BetaResponseToolAdditionBlock { $type = 'tool_addition'; $tool; }
"tool_addition" type
Tool tool

The tool made available: a reference to a tools entry or MCP toolset, or a tool_definition carrying the definition by value.

class BetaResponseToolChangeMCPToolReference { $type = 'mcp_tool_reference'; $name; $serverName; }
"mcp_tool_reference" type
string name
string serverName
class BetaResponseToolChangeMCPToolsetReference { $type = 'mcp_toolset_reference'; $serverName; }
"mcp_toolset_reference" type
string serverName
class BetaResponseToolChangeToolReference { $type = 'tool_reference'; $name; }
"tool_reference" type
string name
class BetaResponseToolInputSchema { $type = 'object'; $properties; $required; }
"object" type
?array<string,mixed> properties
?list<string> required
class BetaResponseToolRemovalBlock { $type = 'tool_removal'; $tool; }
"tool_removal" type
Tool tool

A reference to the withdrawn tools entry, MCP tool or MCP toolset.

One of the following:
class BetaSearchResultBlockParam { $type = 'search_result'; $content; $source; /* 3 more */ }
"search_result" type
list<BetaTextBlockParam> content
string source
string title
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaServerToolCaller { $type = 'code_execution_20250825'; $toolID; }
"code_execution_20250825" type
string toolID
class BetaServerToolCaller20260120 { $type = 'code_execution_20260120'; $toolID; }
"code_execution_20260120" type
string toolID
class BetaServerToolUsage { $webFetchRequests; $webSearchRequests; }
int webFetchRequests

The number of web fetch tool requests.

int webSearchRequests

The number of web search tool requests.

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

Create a cache control breakpoint at this content block.

?Caller caller
class BetaSignatureDelta { $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 BetaSkillParams { $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

One of the following:
"end_turn"
"max_tokens"
"stop_sequence"
"tool_use"
"pause_turn"
"compaction"
"refusal"
"model_context_window_exceeded"
class BetaSummarizeCompaction { $type = 'summarize'; $instructions; }
"summarize" type
?string instructions

Replaces the server's default summarization prompt for this request. An empty or whitespace-only value counts as absent.

class BetaSystemMessageOutputConfig { $effort; }
?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.

class BetaSystemMessageParam { $role; $clearAt; $content; $outputConfig; }
"system" role
?ClearAt clearAt⁠

How long this system message's text stays in front of the model. "never" (the default) renders it on every request that includes it. "next_user_message" renders it only for the user turn it follows: once a later role: "user" message exists in messages the message stays in the array (send it unchanged) but is no longer shown to the model. Only permitted on role: "system" messages.

?Content content
?BetaSystemMessageOutputConfig outputConfig⁠

Per-message output configuration on a role:"system" input message.

Fields here apply per-turn; format remains top-level only. An empty {} is accepted on a message that carries content; a message with neither content nor output_config fields is rejected.

class BetaTextBlock { $type = 'text'; $citations; $text; }
"text" type
?list<BetaTextCitation> 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 BetaTextBlockParam { $type = 'text'; $text; $cacheControl; $citations; }
"text" type
string text
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?list<BetaTextCitationParam> citations
One of the following:
One of the following:
class BetaTextDelta { $type = 'text_delta'; $text; }
"text_delta" type
string text
class BetaTextEditorCodeExecutionCreateResultBlock { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
"text_editor_code_execution_create_result" type
bool isFileUpdate
class BetaTextEditorCodeExecutionCreateResultBlockParam { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
"text_editor_code_execution_create_result" type
bool isFileUpdate
class BetaTextEditorCodeExecutionStrReplaceResultBlock { $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 BetaTextEditorCodeExecutionStrReplaceResultBlockParam { $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 BetaTextEditorCodeExecutionToolResultBlock { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; }
"text_editor_code_execution_tool_result" type
Content content
string toolUseID
class BetaTextEditorCodeExecutionToolResultBlockParam { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
"text_editor_code_execution_tool_result" type
Content content
string toolUseID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaTextEditorCodeExecutionToolResultError { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
"text_editor_code_execution_tool_result_error" type
ErrorCode errorCode
?string errorMessage
class BetaTextEditorCodeExecutionToolResultErrorParam { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
"text_editor_code_execution_tool_result_error" type
ErrorCode errorCode
?string errorMessage
class BetaTextEditorCodeExecutionViewResultBlock { $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 BetaTextEditorCodeExecutionViewResultBlockParam { $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 BetaThinkingBlock { $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 BetaThinkingBlockBinding { $prefixMismatchBehavior; }
?BetaThinkingPrefixMismatchBehavior prefixMismatchBehavior

"error" (default) | "drop_block". What happens when a thinking block in messages fails the conversation check (it was created in a different conversation, or the messages before it have changed since). "error" fails the request with a 400 error. "drop_block" removes the failing blocks and the request proceeds; each removal is reported in input_transformations.

class BetaThinkingBlockParam { $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 BetaThinkingConfigAdaptive { $type = 'adaptive'; $blockBinding; $display; }
"adaptive" type
?BetaThinkingBlockBinding blockBinding⁠

Controls for block binding: what happens when a thinking block this request sends back fails the conversation check. null, absent or an empty object means every default.

?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 BetaThinkingConfigBetweenTools { $type = 'between_tools'; }
"between_tools" type
class BetaThinkingConfigDisabled { $type = 'disabled'; }
"disabled" type
class BetaThinkingConfigEnabled { $type = 'enabled'; $budgetTokens; $blockBinding; $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.

?BetaThinkingBlockBinding blockBinding⁠

Controls for block binding: what happens when a thinking block this request sends back fails the conversation check. null, absent or an empty object means every default.

?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 BetaThinkingDelta { $type = 'thinking_delta'; $estimatedTokens; $thinking; }
"thinking_delta" type
?int estimatedTokens⁠

Per-frame increment of a coarse, running estimate of the tokens this thinking block has produced so far. Present whenever the thinking-token-count-2026-05-13 beta is set; null unless thinking.display resolves to "omitted" and a count is due this frame. Sum the increments across thinking_delta frames on this block for a progress indicator. Each increment is a non-negative multiple of a fixed quantum and the cadence is rate-limited, so this is a deliberately lossy display hint, not a billable count; usage.output_tokens remains authoritative.

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 BetaThinkingDroppedInputTransformation { $type = 'thinking_dropped'; $path; $reason; }
"thinking_dropped" type

Always thinking_dropped for this entry type.

string path

Where the removed block was in your request, as messages.{i}.content.{j}: i indexes the messages array you sent and j that message's content array — the same form error messages use.

Reason reason

Which binding check removed the block: model_binding_mismatch — it was created by a model whose reasoning the requested model may not read; prefix_binding_mismatch — the conversation before it differs from the conversation it was created in (the rest of that turn's consecutive thinking blocks are removed with it, each with this reason); organization_binding_mismatch — it was created under a different organization (an Anthropic organization, AWS account or Google Cloud project) and this organization is not one of its additional organizations; end_user_binding_mismatch — it was created for a different end user, or was removed by the consumer-organization binding. A block that would fail several checks reports one reason, in this order of precedence: organization_binding_mismatch, end_user_binding_mismatch, model_binding_mismatch, prefix_binding_mismatch.

class BetaThinkingMismatchAllowedInputTransformation { $type = 'thinking_mismatch_allowed'; $path; $reason; }
"thinking_mismatch_allowed" type

Always thinking_mismatch_allowed for this entry type.

string path

Where the block is in your request, as messages.{i}.content.{j}: i indexes the messages array you sent and j that message's content array — the same form error messages use.

Reason reason

Which binding check the block failed; the block was shown to the model all the same. Always prefix_binding_mismatch today — the conversation before the block differs from the conversation it was created in, or the block carries no record of one on a model that requires it. Were the check enforced for this request, the block would have been removed or the request rejected (thinking.block_binding.prefix_mismatch_behavior). A removal also takes the rest of that turn's consecutive thinking blocks, whereas here each block is checked on its own, so thinking_mismatch_allowed entries are a lower bound on what enforcement would remove.

One of the following:
"error"
"drop_block"
class BetaThinkingTurns { $type = 'thinking_turns'; $value; }
"thinking_turns" type
int value
class BetaThreadContinueParams { $type = 'continue'; $previousMessageID; }
"continue" type
string previousMessageID

The id of the previous response in this Thread.

class BetaThreadCreateParams { $type = 'create'; }
"create" type
class BetaTokenTaskBudget { $type = 'tokens'; $total; $remaining; }
"tokens" type

The budget type. Currently only 'tokens' is supported.

int total

Total token budget across all contexts in the session.

?int remaining

Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.

class BetaTool { $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
?BetaCacheControlEphemeral 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 BetaToolBash20241022 { $type = 'bash_20241022'; $name; $allowedCallers; /* 4 more */ }
"bash_20241022" 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
?BetaCacheControlEphemeral 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 BetaToolBash20250124 { $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
?BetaCacheControlEphemeral 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 BetaToolChangeMCPToolReference { $type = 'mcp_tool_reference'; $name; $serverName; }
"mcp_tool_reference" type
string name
string serverName
class BetaToolChangeMCPToolsetReference { $type = 'mcp_toolset_reference'; $serverName; }
"mcp_toolset_reference" type
string serverName
class BetaToolChangeToolDefinition { $type = 'tool_definition'; $definition; }
"tool_definition" type
BetaResponseToolUnion definition
class BetaToolChangeToolDefinitionParam { $type = 'tool_definition'; $definition; }
"tool_definition" type
BetaToolUnion definition
class BetaToolChangeToolReference { $type = 'tool_reference'; $name; }
"tool_reference" type
string name
One of the following:
class BetaToolChoiceAny { $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 BetaToolChoiceAuto { $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 BetaToolChoiceNone { $type = 'none'; }
"none" type
class BetaToolChoiceTool { $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 BetaToolComputerUse20241022 { $type = 'computer_20241022'; $displayHeightPx; $displayWidthPx; /* 7 more */ }
"computer_20241022" type
int displayHeightPx

The height of the display in pixels.

int displayWidthPx

The width of the display in pixels.

"computer" name

Name of the tool.

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

?list<AllowedCaller> allowedCallers
?BetaCacheControlEphemeral 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 displayNumber

The X11 display number (e.g. 0, 1) for the display.

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

When true, guarantees schema validation on tool names and inputs

class BetaToolComputerUse20250124 { $type = 'computer_20250124'; $displayHeightPx; $displayWidthPx; /* 7 more */ }
"computer_20250124" type
int displayHeightPx

The height of the display in pixels.

int displayWidthPx

The width of the display in pixels.

"computer" name

Name of the tool.

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

?list<AllowedCaller> allowedCallers
?BetaCacheControlEphemeral 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 displayNumber

The X11 display number (e.g. 0, 1) for the display.

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

When true, guarantees schema validation on tool names and inputs

class BetaToolComputerUse20251124 { $type = 'computer_20251124'; $displayHeightPx; $displayWidthPx; /* 8 more */ }
"computer_20251124" type
int displayHeightPx

The height of the display in pixels.

int displayWidthPx

The width of the display in pixels.

"computer" name

Name of the tool.

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

?list<AllowedCaller> allowedCallers
?BetaCacheControlEphemeral 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 displayNumber

The X11 display number (e.g. 0, 1) for the display.

?bool enableZoom

Whether to enable an action to take a zoomed-in screenshot of the screen.

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

When true, guarantees schema validation on tool names and inputs

class BetaToolReferenceBlock { $type = 'tool_reference'; $toolName; }
"tool_reference" type
string toolName
class BetaToolReferenceBlockParam { $type = 'tool_reference'; $toolName; $cacheControl; }
"tool_reference" type
string toolName
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaToolResultBlockParam { $type = 'tool_result'; $toolUseID; $cacheControl; /* 3 more */ }
"tool_result" type
string toolUseID
?BetaCacheControlEphemeral 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 BetaToolSearchToolBm25_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
?BetaCacheControlEphemeral 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 BetaToolSearchToolRegex20251119 { $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
?BetaCacheControlEphemeral 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 BetaToolSearchToolResultBlock { $type = 'tool_search_tool_result'; $content; $toolUseID; }
"tool_search_tool_result" type
Content content
string toolUseID
class BetaToolSearchToolResultBlockParam { $type = 'tool_search_tool_result'; $content; $toolUseID; $cacheControl; }
"tool_search_tool_result" type
Content content
string toolUseID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

class BetaToolSearchToolResultError { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
"tool_search_tool_result_error" type
ErrorCode errorCode
?string errorMessage
class BetaToolSearchToolResultErrorParam { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
"tool_search_tool_result_error" type
ErrorCode errorCode
?string errorMessage
class BetaToolSearchToolSearchResultBlock { $type = 'tool_search_tool_search_result'; $toolReferences; }
"tool_search_tool_search_result" type
list<BetaToolReferenceBlock> toolReferences
class BetaToolSearchToolSearchResultBlockParam { $type = 'tool_search_tool_search_result'; $toolReferences; }
"tool_search_tool_search_result" type
list<BetaToolReferenceBlockParam> toolReferences
class BetaToolTextEditor20241022 { $type = 'text_editor_20241022'; $name; $allowedCallers; /* 4 more */ }
"text_editor_20241022" 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
?BetaCacheControlEphemeral 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 BetaToolTextEditor20250124 { $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
?BetaCacheControlEphemeral 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 BetaToolTextEditor20250429 { $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
?BetaCacheControlEphemeral 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 BetaToolTextEditor20250728 { $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
?BetaCacheControlEphemeral 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 BetaToolUnion
One of the following:
class BetaToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id
array<string,mixed> input
string name
?Caller caller
?string toolsetName

For a toolset member tool_use, the toolset family.

class BetaToolUseBlockParam { $type = 'tool_use'; $id; $input; /* 4 more */ }
"tool_use" type
string id
array<string,mixed> input
string name
?BetaCacheControlEphemeral 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.

One of the following:
class BetaDirectCaller { $type = 'direct'; }
"direct" type
class BetaServerToolCaller { $type = 'code_execution_20250825'; $toolID; }
"code_execution_20250825" type
string toolID
class BetaServerToolCaller20260120 { $type = 'code_execution_20260120'; $toolID; }
"code_execution_20260120" type
string toolID
class BetaToolUsesKeep { $type = 'tool_uses'; $value; }
"tool_uses" type
int value
class BetaToolUsesTrigger { $type = 'tool_uses'; $value; }
"tool_uses" type
int value
One of the following:
One of the following:
One of the following:
class BetaToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
"tool_use" type
string id
array<string,mixed> input
string name
?Caller caller
?string toolsetName

For a toolset member tool_use, the toolset family.

class BetaURLImageSource { $type = 'url'; $url; }
"url" type
string url
class BetaURLPDFSource { $type = 'url'; $url; }
"url" type
string url
class BetaUsage { $cacheCreation; $cacheCreationInputTokens; $cacheReadInputTokens; /* 9 more */ }
class BetaUserLocation { $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 BetaUserMessageParam { $content; $role; }
"user" role
class BetaWebFetchBlock { $type = 'web_fetch_result'; $content; $retrievedAt; $url; }
"web_fetch_result" type
?string retrievedAt

ISO 8601 timestamp when the content was retrieved

string url

Fetched content URL

class BetaWebFetchBlockParam { $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 BetaWebFetchTool20250910 { $type = 'web_fetch_20250910'; $name; $allowedCallers; /* 9 more */ }
class BetaWebFetchTool20260209 { $type = 'web_fetch_20260209'; $name; $allowedCallers; /* 9 more */ }
class BetaWebFetchTool20260309 { $type = 'web_fetch_20260309'; $name; $allowedCallers; /* 10 more */ }
class BetaWebFetchTool20260318 { $type = 'web_fetch_20260318'; $name; $allowedCallers; /* 11 more */ }
class BetaWebFetchToolResultBlock { $type = 'web_fetch_tool_result'; $content; $toolUseID; $caller; }
"web_fetch_tool_result" type
Content content
string toolUseID
?Caller caller
class BetaWebFetchToolResultBlockParam { $type = 'web_fetch_tool_result'; $content; $toolUseID; /* 2 more */ }
"web_fetch_tool_result" type
Content content
string toolUseID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?Caller caller
class BetaWebFetchToolResultErrorBlock { $type = 'web_fetch_tool_result_error'; $errorCode; }
"web_fetch_tool_result_error" type
class BetaWebFetchToolResultErrorBlockParam { $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 BetaWebFetchURLSourceAll { $type = 'all'; }
"all" type
class BetaWebFetchURLSourceExcept { $type = 'except'; $tools; }
"except" type
class BetaWebFetchURLSourceNone { $type = 'none'; }
"none" type
class BetaWebFetchURLSourceOnly { $type = 'only'; $tools; }
"only" type
class BetaWebFetchURLSourceToolReference { $type = 'tool_reference'; $name; }
"tool_reference" type
string name
class BetaWebFetchURLSources { $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 BetaWebSearchResultBlock { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
"web_search_result" type
string encryptedContent
?string pageAge
string title
string url
class BetaWebSearchResultBlockParam { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
"web_search_result" type
string encryptedContent
string title
string url
?string pageAge
class BetaWebSearchTool20250305 { $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.

?BetaCacheControlEphemeral 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

?BetaUserLocation userLocation

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

class BetaWebSearchTool20260209 { $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.

?BetaCacheControlEphemeral 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

?BetaUserLocation userLocation

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

class BetaWebSearchTool20260318 { $type = 'web_search_20260318'; $name; $allowedCallers; /* 8 more */ }
class BetaWebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
"web_search_tool_result_error" type
class BetaWebSearchToolResultBlock { $type = 'web_search_tool_result'; $content; $toolUseID; $caller; }
"web_search_tool_result" type
string toolUseID
?Caller caller
One of the following:
class BetaWebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
"web_search_tool_result_error" type
class list<BetaWebSearchResultBlock> { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
"web_search_result" type
string encryptedContent
?string pageAge
string title
string url
class BetaWebSearchToolResultBlockParam { $type = 'web_search_tool_result'; $content; $toolUseID; /* 2 more */ }
"web_search_tool_result" type
string toolUseID
?BetaCacheControlEphemeral cacheControl

Create a cache control breakpoint at this content block.

?Caller caller
One of the following:
class list<BetaWebSearchResultBlockParam> { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
"web_search_result" type
string encryptedContent
string title
string url
?string pageAge
class BetaWebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
"web_search_tool_result_error" type
class BetaWebSearchToolResultError { $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"

NachrichtenBatches

Einen Message Batch erstellen
$client->beta->messages->batches->create(list<Request> requests, ?list<AnthropicBeta> betas, ?string userProfileID, ?string workspaceID): MessageBatch
POST/v1/messages/batches

Sende einen Batch von Anfragen zur Erstellung von Nachrichten.

Einen Message Batch abrufen
$client->beta->messages->batches->retrieve(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): MessageBatch
GET/v1/messages/batches/{message_batch_id}

Dieser Endpunkt ist idempotent und kann verwendet werden, um den Abschluss eines Message Batch per Polling abzufragen. Um auf die Ergebnisse eines Message Batch zuzugreifen, sende eine Anfrage an die im Feld results_url der Antwort angegebene URL.

Message Batches auflisten
$client->beta->messages->batches->list(?string afterID, ?string beforeID, ?int limit, ?list<AnthropicBeta> betas, ?string workspaceID): Page<MessageBatch>
GET/v1/messages/batches

Liste alle Message Batches innerhalb eines Workspace auf. Die zuletzt erstellten Batches werden zuerst zurückgegeben.

Einen Message Batch abbrechen
$client->beta->messages->batches->cancel(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): MessageBatch
POST/v1/messages/batches/{message_batch_id}/cancel

Batches können jederzeit vor Ende der Verarbeitung abgebrochen werden. Sobald der Abbruch eingeleitet wurde, wechselt der Batch in den Zustand canceling; in dieser Zeit kann das System laufende, nicht unterbrechbare Anfragen noch abschließen, bevor der Abbruch finalisiert wird.

Einen Message Batch löschen
$client->beta->messages->batches->delete(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): DeletedMessageBatch
DELETE/v1/messages/batches/{message_batch_id}

Lösche einen Message Batch.

Ergebnisse eines Message Batch abrufen
$client->beta->messages->batches->resultsStream(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): BaseStream<MessageBatchIndividualResponse>
GET/v1/messages/batches/{message_batch_id}/results

Streamt die Ergebnisse eines Message Batch als .jsonl-Datei.