Сообщения
Создать сообщение
$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Отправьте структурированный список входных сообщений с текстом и/или изображениями, и модель сгенерирует следующее сообщение в разговоре.
Подсчитать токены в сообщении
$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Подсчитайте количество токенов в сообщении.
Models
class BetaAdvisorMessageIterationUsage { $type = 'advisor_message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
Usage for an advisor sub-inference iteration
Breakdown of cached tokens by TTL
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The number of input tokens which were used.
The number of output tokens which were used.
class BetaAdvisorRedactedResultBlock { $type = 'advisor_redacted_result'; $encryptedContent; $stopReason; }
Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
The advisor sub-inference's stop reason (same values as the top-level message stop_reason).
class BetaAdvisorRedactedResultBlockParam { $type = 'advisor_redacted_result'; $encryptedContent; $stopReason; }
Opaque blob produced by a prior response; must be round-tripped verbatim.
class BetaAdvisorResultBlock { $type = 'advisor_result'; $stopReason; $text; }
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.
class BetaAdvisorResultBlockParam { $type = 'advisor_result'; $text; $stopReason; }
class BetaAdvisorTool20260301 { $type = 'advisor_20260301'; $model; $name; /* 7 more */ }
class BetaAdvisorToolResultBlock { $type = 'advisor_tool_result'; $content; $toolUseID; }
class BetaAdvisorToolResultBlockParam { $type = 'advisor_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaAdvisorToolResultError { $type = 'advisor_tool_result_error'; $errorCode; }
class BetaAdvisorToolResultErrorParam { $type = 'advisor_tool_result_error'; $errorCode; }
class BetaAllThinkingTurns { $type = 'all'; }
class BetaAssistantMessageParam { $content; $role; }
class BetaBase64ImageSource { $type = 'base64'; $data; $mediaType; }
class BetaBase64PDFSource { $type = 'base64'; $data; $mediaType; }
class BetaBashCodeExecutionOutputBlock { $type = 'bash_code_execution_output'; $fileID; }
class BetaBashCodeExecutionOutputBlockParam { $type = 'bash_code_execution_output'; $fileID; }
class BetaBashCodeExecutionResultBlock { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
class BetaBashCodeExecutionResultBlockParam { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
class BetaBashCodeExecutionToolResultBlock { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; }
class BetaBashCodeExecutionToolResultBlockParam { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaBashCodeExecutionToolResultError { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
class BetaBashCodeExecutionToolResultErrorParam { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
class BetaBrowserClickTarget
class BetaBrowserCoordinateTarget { $type = 'coordinate'; $x; $y; }
Pixels from the left edge of the viewport.
Pixels from the top edge of the viewport.
class BetaBrowserRefTarget { $type = 'ref'; $ref; }
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
class BetaBrowserCloseTabConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserCloseTabInput { $tabID; }
The tab to close.
class BetaBrowserCloseTabToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Close the tab with the given tab_id.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserCoordinateTarget { $type = 'coordinate'; $x; $y; }
Pixels from the left edge of the viewport.
Pixels from the top edge of the viewport.
class BetaBrowserDoubleClickConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserDoubleClickInput { $target; $modifiers; $tabID; }
Where to act: either a viewport coordinate or an element reference.
Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserDoubleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Double left-click at a viewport coordinate or on an element by reference.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserFileUploadConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class 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.
References to files the harness has staged, for deployments where the browser executor cannot read the caller's filesystem.
File paths on the browser executor's filesystem.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserFileUploadToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserFindConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserFindInput { $query; $tabID; }
Natural-language description of the element(s) to find.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserFindToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Find elements matching a natural-language description (e.g. "search bar", "add to cart button") and return up to 20 matches with element references.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserFormInputConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class 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.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserFormInputToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Set the value of a form element (input, textarea, select, checkbox). Use a boolean for checkboxes, an option value or text for selects.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserGetPageTextConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserGetPageTextInput { $tabID; }
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserGetPageTextToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Return the page's visible text content as plain text, prioritizing article content. Suited to articles, documentation, and other text-heavy pages.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserHoldKeyConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserHoldKeyInput { $duration; $text; $tabID; }
Seconds to hold the key down (maximum 30).
The key or chord to hold.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserHoldKeyToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserHoverConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserHoverInput { $target; $tabID; }
Where to act: either a viewport coordinate or an element reference.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserHoverToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Move the cursor to a coordinate or element without clicking.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserJavascriptExecConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserJavascriptExecInput { $text; $tabID; }
JavaScript to execute in the page context.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserJavascriptExecToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserKeyConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserKeyInput { $text; $repeat; $tabID; }
The key, chord, or space-separated sequence to press.
Number of times to repeat. Default 1.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserKeyToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserLeftClickConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserLeftClickDragConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class 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).
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserLeftClickDragToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Press at from, drag to target, release. Both must be coordinate targets.
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.
Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserLeftClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Left-click at a viewport coordinate or on an element by reference.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserLeftMouseDownConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserLeftMouseDownInput { $target; $tabID; }
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserLeftMouseDownToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Press and hold the left mouse button at a viewport coordinate. Pair with left_mouse_up to perform a custom drag.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserLeftMouseUpConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserLeftMouseUpInput { $target; $tabID; }
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserLeftMouseUpToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Release the left mouse button at a viewport coordinate.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserListTabsConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserListTabsToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
List all open tabs with each tab's tab_id, title, and URL.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserMiddleClickConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserMiddleClickInput { $target; $modifiers; $tabID; }
Where to act: either a viewport coordinate or an element reference.
Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserMiddleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Middle-click at a viewport coordinate or on an element by reference.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserMouseMoveConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserMouseMoveInput { $target; $tabID; }
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserMouseMoveToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Move the pointer to a viewport coordinate without clicking.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserNavigateConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserNavigateInput { $url; $tabID; }
The URL to navigate to, or "back" / "forward" / "reload" for history navigation.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserNavigateToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Navigate to a URL, or go back/forward/reload in history. The protocol may be omitted (defaults to https://).
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserNewTabConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserNewTabToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Open a new empty tab and return its tab_id.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserReadConsoleConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserReadConsoleInput { $tabID; }
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserReadConsoleToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserReadNetworkConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserReadNetworkInput { $tabID; }
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserReadNetworkToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserReadPageConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserReadPageInput { $depth; $filter; $ref; $tabID; }
Maximum tree depth. Default 15.
Which elements to include. Omitted: every visible element. "interactive": interactive elements only. "all": additionally includes off-viewport elements.
Element reference to read a subtree from. Omit to read from the page root.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserReadPageToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserRefTarget { $type = 'ref'; $ref; }
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
class BetaBrowserRightClickConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserRightClickInput { $target; $modifiers; $tabID; }
Where to act: either a viewport coordinate or an element reference.
Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserRightClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Right-click at a viewport coordinate or on an element by reference.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserScreenshotConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserScreenshotInput { $tabID; }
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserScreenshotToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Capture the current browser viewport.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserScrollConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserScrollInput { $scrollDirection; $target; $scrollAmount; $tabID; }
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
Scroll-wheel notches (1–10). Default 3.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserScrollToConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class 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.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserScrollToToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Scroll an element into view.
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 */ }
Scroll at a viewport position. target must be a coordinate target.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserStateBlockParam { $type = 'browser_state'; $tabs; $cacheControl; $stateChanges; }
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.
Create a cache control breakpoint at this content block.
Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
class BetaBrowserStateChange
class BetaBrowserStateChangeDownloadCompleted { $type = 'download_completed'; $downloadID; $url; /* 2 more */ }
The caller-assigned identifier for this download, stable across the state changes reporting it.
The final post-redirect URL the download was served from.
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.
The completed download's size.
class BetaBrowserStateChangeDownloadFailed { $type = 'download_failed'; $downloadID; $url; $error; }
The caller-assigned identifier for this download, stable across the state changes reporting it.
The final post-redirect URL the download was served from.
The failure or cancellation detail, when known.
class BetaBrowserStateChangeDownloadStarted { $type = 'download_started'; $downloadID; $url; }
The caller-assigned identifier for this download, stable across the state changes reporting it.
The final post-redirect URL the download was served from.
class BetaBrowserStateChangeTabOpened { $type = 'tab_opened'; $tabID; }
The tab_id of the opened tab, present in tabs.
class BetaBrowserStateTabEntry { $tabID; $title; $url; $active; }
The caller-assigned identifier for this tab, unique within the inventory.
The title of the page the tab is showing. May be empty.
The URL of the page the tab is showing. May be empty.
Whether this tab is the active tab after this call. Whenever tabs is non-empty, exactly one entry is marked active: true.
class BetaBrowserSwitchTabConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserSwitchTabInput { $tabID; }
The tab to switch to.
class BetaBrowserSwitchTabToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Make the tab with the given tab_id the active tab — the tab that actions without a tab_id apply to.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserToolUseBlock
class BetaBrowserToolset20260801 { $type = 'browser_toolset_20260801'; $cacheControl; $configs; }
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; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserTripleClickInput { $target; $modifiers; $tabID; }
Where to act: either a viewport coordinate or an element reference.
Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserTripleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Triple left-click at a viewport coordinate or on an element by reference (typically selects a line or paragraph).
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserTypeConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserTypeInput { $text; $tabID; }
The text to type.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserTypeToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Type a literal string at the current focus.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserWaitConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserWaitInput { $duration; $tabID; }
Seconds to wait (maximum 30).
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserWaitToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Pause for the given duration.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaBrowserZoomConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaBrowserZoomInput { $region; $tabID; }
[x0, y0, x1, y1] in viewport pixels.
Tab to act on. Defaults to the active tab when omitted.
class BetaBrowserZoomToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaCacheControlEphemeral { $type = 'ephemeral'; $ttl; }
?TTL ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
class BetaCacheCreation { $ephemeral1hInputTokens; $ephemeral5mInputTokens; }
The number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 5 minute cache entry.
class BetaCacheMissMessagesChanged { $type = 'messages_changed'; $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; }
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'; }
class BetaCacheMissReason
class BetaCacheMissSystemChanged { $type = 'system_changed'; $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; }
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissUnavailable { $type = 'unavailable'; }
class BetaCitationCharLocation { $type = 'char_location'; $citedText; $documentIndex; /* 4 more */ }
class BetaCitationCharLocationParam { $type = 'char_location'; $citedText; $documentIndex; /* 3 more */ }
class BetaCitationConfig { $enabled; }
class BetaCitationContentBlockLocation { $type = 'content_block_location'; $citedText; $documentIndex; /* 4 more */ }
string citedTextThe full text of the cited block range, concatenated.
The full text of the cited block range, concatenated.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
int endBlockIndexExclusive 0-based end index of the cited block range in the source's content array.
Exclusive 0-based end index of the cited block range in the source's content array.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
0-based index of the first cited block in the source's content array.
class BetaCitationContentBlockLocationParam { $type = 'content_block_location'; $citedText; $documentIndex; /* 3 more */ }
string citedTextThe full text of the cited block range, concatenated.
The full text of the cited block range, concatenated.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
int endBlockIndexExclusive 0-based end index of the cited block range in the source's content array.
Exclusive 0-based end index of the cited block range in the source's content array.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
0-based index of the first cited block in the source's content array.
class BetaCitationPageLocation { $type = 'page_location'; $citedText; $documentIndex; /* 4 more */ }
class BetaCitationPageLocationParam { $type = 'page_location'; $citedText; $documentIndex; /* 3 more */ }
class BetaCitationSearchResultLocation { $type = 'search_result_location'; $citedText; $endBlockIndex; /* 4 more */ }
string citedTextThe full text of the cited block range, concatenated.
The full text of the cited block range, concatenated.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
int endBlockIndexExclusive 0-based end index of the cited block range in the source's content array.
Exclusive 0-based end index of the cited block range in the source's content array.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
int searchResultIndex0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.
0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.
Counted separately from document_index; server-side web search results are not included in this count.
0-based index of the first cited block in the source's content array.
class BetaCitationSearchResultLocationParam { $type = 'search_result_location'; $citedText; $endBlockIndex; /* 4 more */ }
string citedTextThe full text of the cited block range, concatenated.
The full text of the cited block range, concatenated.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
int endBlockIndexExclusive 0-based end index of the cited block range in the source's content array.
Exclusive 0-based end index of the cited block range in the source's content array.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
int searchResultIndex0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.
0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.
Counted separately from document_index; server-side web search results are not included in this count.
0-based index of the first cited block in the source's content array.
class BetaCitationWebSearchResultLocationParam { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
class BetaCitationsConfigParam { $enabled; }
class BetaCitationsDelta { $type = 'citations_delta'; $citation; }
class BetaCitationsWebSearchResultLocation { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
class BetaClearThinking20251015Edit { $type = 'clear_thinking_20251015'; $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; }
The type of context management edit applied.
Number of input tokens cleared by this edit.
Number of thinking turns that were cleared.
class BetaClearToolUses20250919Edit { $type = 'clear_tool_uses_20250919'; $clearAtLeast; $clearToolInputs; /* 3 more */ }
Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
Tool names whose uses are preserved from clearing
Number of tool uses to retain in the conversation
Condition that triggers the context management strategy
class BetaClearToolUses20250919EditResponse { $type = 'clear_tool_uses_20250919'; $clearedInputTokens; $clearedToolUses; }
The type of context management edit applied.
Number of input tokens cleared by this edit.
Number of tool uses that were cleared.
class BetaCodeExecutionOutputBlock { $type = 'code_execution_output'; $fileID; }
class BetaCodeExecutionOutputBlockParam { $type = 'code_execution_output'; $fileID; }
class BetaCodeExecutionResultBlock { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
class BetaCodeExecutionResultBlockParam { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
class BetaCodeExecutionTool20250522 { $type = 'code_execution_20250522'; $name; $allowedCallers; /* 3 more */ }
"code_execution" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaCodeExecutionTool20250825 { $type = 'code_execution_20250825'; $name; $allowedCallers; /* 3 more */ }
"code_execution" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaCodeExecutionTool20260120 { $type = 'code_execution_20260120'; $name; $allowedCallers; /* 3 more */ }
"code_execution" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaCodeExecutionTool20260521 { $type = 'code_execution_20260521'; $name; $allowedCallers; /* 3 more */ }
"code_execution" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaCodeExecutionToolResultBlock { $type = 'code_execution_tool_result'; $content; $toolUseID; }
class BetaCodeExecutionToolResultBlockParam { $type = 'code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaCodeExecutionToolResultError { $type = 'code_execution_tool_result_error'; $errorCode; }
class BetaCodeExecutionToolResultErrorParam { $type = 'code_execution_tool_result_error'; $errorCode; }
class BetaCompact20260112Edit { $type = 'compact_20260112'; $instructions; $pauseAfterCompaction; $trigger; }
Additional instructions for summarization.
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 */ }
Summary of compacted content, or null if compaction failed
Opaque metadata from prior compaction, to be round-tripped verbatim
Signature over the summary, to be sent back with the block verbatim
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 */ }
Create a cache control breakpoint at this content block.
Summary of previously compacted content, or null if compaction failed
Opaque metadata from prior compaction, to be round-tripped verbatim
The block's signature as returned, to be sent back verbatim
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; }
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; }
Opaque metadata from prior compaction, to be round-tripped verbatim
class BetaCompactionIterationUsage { $type = 'compaction'; $cacheCreation; $cacheCreationInputTokens; /* 3 more */ }
Usage for a compaction iteration
Breakdown of cached tokens by TTL
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The number of input tokens which were used.
The number of output tokens which were used.
class BetaComputerCursorPositionConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerCursorPositionToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Get the current (x, y) pixel coordinate of the cursor.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerDoubleClickConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerDoubleClickInput { $coordinate; $text; }
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class BetaComputerDoubleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Double-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerHoldKeyConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerHoldKeyInput { $duration; $text; }
Duration to hold the key, in seconds.
The key or key-combination to hold.
class BetaComputerHoldKeyToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Hold down a key or key-combination for a specified duration. Uses the same key
syntax as key.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerKeyConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerKeyInput { $text; $repeat; }
The key or key-combination to press.
Number of times to repeat the key press. Default is 1.
class BetaComputerKeyToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerLeftClickConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerLeftClickDragConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerLeftClickDragInput { $coordinate; $startCoordinate; $text; }
(x, y): x pixels from the left edge, y pixels from the top edge.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class BetaComputerLeftClickDragToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Click and drag the cursor from start_coordinate to coordinate.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerLeftClickInput { $coordinate; $text; }
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class BetaComputerLeftClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Click the left mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerLeftMouseDownConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerLeftMouseDownToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Press and hold the left mouse button at the current cursor position.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerLeftMouseUpConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerLeftMouseUpToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Release the left mouse button.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerMiddleClickConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerMiddleClickInput { $coordinate; $text; }
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class BetaComputerMiddleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Click the middle mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerMouseMoveConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerMouseMoveInput { $coordinate; }
(x, y): x pixels from the left edge, y pixels from the top edge.
class BetaComputerMouseMoveToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Move the cursor to a specified (x, y) pixel coordinate. Use this ONLY to hover without clicking; otherwise use a click action directly.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerRightClickConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerRightClickInput { $coordinate; $text; }
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class BetaComputerRightClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Click the right mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerScreenshotConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerScreenshotToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Take a screenshot of the screen.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerScrollConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerScrollInput { $scrollAmount; $scrollDirection; $coordinate; $text; }
Number of 'clicks' of the scroll wheel.
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class BetaComputerScrollToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerToolUseBlock
class BetaComputerToolset20260801 { $type = 'computer_toolset_20260801'; $cacheControl; $configs; }
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; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerTripleClickInput { $coordinate; $text; }
(x, y): x pixels from the left edge, y pixels from the top edge.
Optional key combination to hold down during this action (e.g. "ctrl", "shift", "ctrl+shift").
class BetaComputerTripleClickToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Triple-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerTypeConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerTypeInput { $text; }
The text to type.
class BetaComputerTypeToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Type a string of text on the keyboard.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerWaitConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerWaitInput { $duration; }
Duration to wait, in seconds.
class BetaComputerWaitToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
Wait for a specified duration.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaComputerZoomConfig { $deferLoading; $enabled; }
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
class BetaComputerZoomInput { $region; }
(x0, y0, x1, y1): The region to capture.
class BetaComputerZoomToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
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.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
class BetaContainer { $id; $expiresAt; $skills; }
Identifier for the container used in this request
The time at which the container will expire.
Skills loaded in the container
class BetaContainerParams { $id; $skills; }
Container id
List of skills to load in the container
class BetaContainerSkill { $type; $skillID; $version; }
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Skill ID
The resolved version: a skill version ID for custom skills.
class BetaContainerUploadBlock { $type = 'container_upload'; $fileID; }
class BetaContainerUploadBlockParam { $type = 'container_upload'; $fileID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaContentBlock
class BetaContentBlockParam
class BetaContentBlockSource { $type = 'content'; $content; }
class BetaContextManagementConfig { $edits; }
List of context management edits to apply
class BetaContextManagementResponse { $appliedEdits; }
List of context management edits that were applied.
class BetaCountTokensContextManagementResponse { $originalInputTokens; }
The original token count before context management was applied
class BetaDiagnostics { $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; }
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'; }
class BetaDocumentBlock { $type = 'document'; $citations; $source; $title; }
Citation configuration for the document
The title of the document
class BetaEncryptedCodeExecutionResultBlock { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
class BetaEncryptedCodeExecutionResultBlockParam { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
class BetaFallbackBlock { $type = 'fallback'; $from; $to; $trigger; }
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; }
Identifies one hop of a fallback transition.
Identifies one hop of a fallback transition.
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; }
Reason reasonWhy the reprice was not applied.
Why the reprice was not applied.
A closed enum; additions to the redemption-check vocabulary arrive as deliberate schema updates.
?list<string> removeToRedeemRequest fields to remove before retrying, so the retry can redeem this
token.
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'; }
class BetaFallbackCreditTokenParam { $token; $mode; }
The opaque fallback_credit_token from a prior refusal's stop_details — the same string the bare-string form carries.
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 statusWhether the fallback-credit reprice was applied to this response's billing.
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; }
class BetaFallbackInfoParam { $model; }
class BetaFallbackMessageIterationUsage { $type = 'fallback_message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
Usage for the fallback-model attempt that served the response
Breakdown of cached tokens by TTL
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The number of input tokens which were used.
The number of output tokens which were used.
class BetaFallbackParam { $model; $maxTokens; $outputConfig; /* 2 more */ }
?int maxTokensThe 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.
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 outputConfigOutput parameters for the fallback attempt that uses this fallbacks entry's model, combined with the request's output_config one field at a time.
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'sformat. If you set it tonull, the attempt runs without a format.effort: If you leave it out, the attempt uses the request'seffortwhenmodelsupports that level with the attempt'sthinking. If the request doesn't seteffort, ifmodeldoesn't support the level, or if you setefforttonull, the attempt runs at the default effort ofmodel.task_budget: If you leave it out, the attempt uses the request'stask_budgetwhenmodelaccepts a task budget of that size. If the request doesn't settask_budget, ifmodeldoesn't accept it, or if you settask_budgettonull, 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 speedThe 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.
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 thinkingThe 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.
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; }
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.
class BetaFallbacksParam
class list<BetaFallbackParam> { $model; $maxTokens; $outputConfig; /* 2 more */ }
?int maxTokensThe 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.
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 outputConfigOutput parameters for the fallback attempt that uses this fallbacks entry's model, combined with the request's output_config one field at a time.
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'sformat. If you set it tonull, the attempt runs without a format.effort: If you leave it out, the attempt uses the request'seffortwhenmodelsupports that level with the attempt'sthinking. If the request doesn't seteffort, ifmodeldoesn't support the level, or if you setefforttonull, the attempt runs at the default effort ofmodel.task_budget: If you leave it out, the attempt uses the request'stask_budgetwhenmodelaccepts a task budget of that size. If the request doesn't settask_budget, ifmodeldoesn't accept it, or if you settask_budgettonull, 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 speedThe 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.
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 thinkingThe 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.
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 BetaFileDocumentSource { $type = 'file'; $fileID; }
class BetaFileImageSource { $type = 'file'; $fileID; }
class BetaImageBlockParam { $type = 'image'; $source; $cacheControl; $transformations; }
Create a cache control breakpoint at this content block.
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; }
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; }
class BetaInputTokensClearAtLeast { $type = 'input_tokens'; $value; }
class BetaInputTokensTrigger { $type = 'input_tokens'; $value; }
class BetaInputTransformation
list<BetaIterationsUsageItem>
class BetaJSONOutputFormat { $type = 'json_schema'; $schema; }
The JSON schema of the format
class BetaMCPTool { $inputSchema; $name; $description; }
class BetaMCPToolConfig { $deferLoading; $enabled; }
class BetaMCPToolDefaultConfig { $deferLoading; $enabled; }
class BetaMCPToolListingBlock { $type = 'mcp_tool_listing'; $mcpServerName; $tools; }
class BetaMCPToolListingBlockParam { $type = 'mcp_tool_listing'; $mcpServerName; $tools; }
The name of the MCP server this listing came from, as mcp_servers declares it.
The server's tools, exactly as the response listed them.
class BetaMCPToolParam { $inputSchema; $name; $description; }
The tool's input schema as the MCP server lists it, verbatim.
The tool's name as the MCP server lists it (not prefixed with the server name).
The tool's description as the MCP server lists it.
class BetaMCPToolResultBlock { $type = 'mcp_tool_result'; $content; $isError; $toolUseID; }
class BetaMCPToolUseBlock { $type = 'mcp_tool_use'; $id; $input; /* 2 more */ }
The name of the MCP tool
The name of the MCP server
class BetaMCPToolUseBlockParam { $type = 'mcp_tool_use'; $id; $input; /* 3 more */ }
The name of the MCP server
Create a cache control breakpoint at this content block.
class BetaMCPToolset { $type = 'mcp_toolset'; $mcpServerName; $cacheControl; /* 3 more */ }
Name of the MCP server to configure tools for
Create a cache control breakpoint at this content block.
Configuration overrides for specific tools, keyed by tool name
Default configuration applied to all tools from this server
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" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaMemoryTool20250818CreateCommand { $command; $fileText; $path; }
Command type identifier
Content to write to the file
Path where the file should be created
class BetaMemoryTool20250818DeleteCommand { $command; $path; }
Command type identifier
Path to the file or directory to delete
class BetaMemoryTool20250818InsertCommand { $command; $insertLine; $insertText; $path; }
Command type identifier
Line number where text should be inserted
Text to insert at the specified line
Path to the file where text should be inserted
class BetaMemoryTool20250818RenameCommand { $command; $newPath; $oldPath; }
Command type identifier
New path for the file or directory
Current path of the file or directory
class BetaMemoryTool20250818StrReplaceCommand { $command; $newStr; $oldStr; $path; }
Command type identifier
Text to replace with
Text to search for and replace
Path to the file where text should be replaced
class BetaMemoryTool20250818ViewCommand { $command; $path; $viewRange; }
Command type identifier
Path to directory or file to view
Optional line range for viewing specific lines
class BetaMessage { $type = 'message'; $id; $container; /* 10 more */ }
class BetaMessageContentParam
class BetaMessageDeltaUsage { $cacheCreationInputTokens; $cacheReadInputTokens; $fallbackCredit; /* 5 more */ }
The cumulative number of input tokens used to create the cache entry.
The cumulative number of input tokens read from the cache.
?BetaFallbackCreditUsage fallbackCreditOutcome of the fallback_credit_token presented on this request.
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).
The cumulative number of input tokens which were used.
?list<BetaIterationsUsageItem> iterationsPer-iteration token usage breakdown.
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
messageentry - 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.
The cumulative number of output tokens which were used.
?BetaOutputTokensDetails outputTokensDetailsBreakdown of output tokens by category.
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.
The number of server tool requests.
class BetaMessageIterationUsage { $type = 'message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
Usage for a sampling iteration
Breakdown of cached tokens by TTL
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The number of input tokens which were used.
The number of output tokens which were used.
class BetaMessageParam
class BetaMessageThreadParam
class BetaThreadCreateParams { $type = 'create'; }
class BetaThreadContinueParams { $type = 'continue'; $previousMessageID; }
The id of the previous response in this Thread.
class BetaMessageTokensCount { $contextManagement; $inputTokens; }
Information about context management applied to the message.
The total number of tokens across the provided list of messages, system prompt, and tools.
class BetaMetadata { $userID; }
?string userIDAn external identifier for the user who is associated with the request.
An external identifier for the user who is associated with the request.
This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
class BetaOutputConfig { $effort; $format; $taskBudget; }
?Effort effortHow much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
Valid values are low, medium, high, xhigh, or max.
A schema to specify Claude's output format in responses. See structured outputs
Configuration for token budget tracking across contexts.
class BetaOutputTokensDetails { $thinkingTokens; }
int thinkingTokensNumber of output tokens the model generated as internal reasoning, including
the thinking-block delimiter tokens.
Number of output tokens the model generated as internal reasoning, including the thinking-block delimiter tokens.
Reflects the raw reasoning the model produced, not the (possibly shorter)
summarized thinking text returned in the response body. It may differ from the model's exact
generation count by a small number of tokens. Always ≤ output_tokens;
output_tokens - thinking_tokens approximates the non-reasoning output.
class BetaPlainTextSource { $type = 'text'; $data; $mediaType; }
class BetaRawContentBlockDelta
class BetaRawContentBlockDeltaEvent { $type = 'content_block_delta'; $delta; $index; }
class BetaRawContentBlockStartEvent { $type = 'content_block_start'; $contentBlock; $index; }
class BetaRawContentBlockStopEvent { $type = 'content_block_stop'; $index; }
class BetaRawMessageDeltaEvent { $type = 'message_delta'; $contextManagement; $delta; /* 2 more */ }
Information about context management strategies applied during the request
BetaMessageDeltaUsage usageBilling and rate-limit usage.
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> inputTransformationsChanges 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.
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; }
class BetaRawMessageStopEvent { $type = 'message_stop'; }
class BetaRedactedThinkingBlock { $type = 'redacted_thinking'; $data; }
string dataThe contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.
The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.
Pass redacted_thinking blocks back to the API unchanged when continuing a multi-turn conversation.
See extended thinking for details.
class BetaRedactedThinkingBlockParam { $type = 'redacted_thinking'; $data; }
The data value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.
class BetaRefusalStopDetails { $type = 'refusal'; $category; $explanation; /* 3 more */ }
?Category categoryThe policy category that triggered the refusal.
The policy category that triggered the refusal.
null when the refusal doesn't map to a named category.
?string explanationHuman-readable explanation of the refusal.
Human-readable explanation of the refusal.
This text is not guaranteed to be stable. null when no explanation is available for the category.
?string fallbackCreditTokenOpaque 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.
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 fallbackHasPrefillClaimWhether the accompanying fallback_credit_token may be redeemed with the
appended-assistant retry form. Only set when fallback_credit_token is
present.
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.
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 */ }
Create a cache control breakpoint at this content block.
class BetaRequestMCPServerToolConfiguration { $allowedTools; $enabled; }
class BetaRequestMCPServerURLDefinition { $type = 'url'; $name; $url; /* 2 more */ }
class BetaRequestMCPToolResultBlockParam { $type = 'mcp_tool_result'; $toolUseID; $cacheControl; /* 2 more */ }
Create a cache control breakpoint at this content block.
class BetaRequestToolAdditionBlock { $type = 'tool_addition'; $tool; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaRequestToolRemovalBlock { $type = 'tool_removal'; $tool; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaResponseTool { $type; $inputSchema; $name; /* 6 more */ }
BetaResponseToolInputSchema inputSchemaJSON schema for this tool's input.
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 nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
?string descriptionDescription of what this tool does.
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.
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.
When true, guarantees schema validation on tool names and inputs
class BetaResponseToolAdditionBlock { $type = 'tool_addition'; $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; }
class BetaResponseToolChangeMCPToolsetReference { $type = 'mcp_toolset_reference'; $serverName; }
class BetaResponseToolChangeToolReference { $type = 'tool_reference'; $name; }
class BetaResponseToolInputSchema { $type = 'object'; $properties; $required; }
class BetaResponseToolRemovalBlock { $type = 'tool_removal'; $tool; }
A reference to the withdrawn tools entry, MCP tool or MCP toolset.
class BetaResponseToolUnion
class BetaSearchResultBlockParam { $type = 'search_result'; $content; $source; /* 3 more */ }
Create a cache control breakpoint at this content block.
class BetaServerToolCaller { $type = 'code_execution_20250825'; $toolID; }
class BetaServerToolCaller20260120 { $type = 'code_execution_20260120'; $toolID; }
class BetaServerToolUsage { $webFetchRequests; $webSearchRequests; }
The number of web fetch tool requests.
The number of web search tool requests.
class BetaServerToolUseBlock { $type = 'server_tool_use'; $id; $input; /* 2 more */ }
class BetaServerToolUseBlockParam { $type = 'server_tool_use'; $id; $input; /* 3 more */ }
Create a cache control breakpoint at this content block.
class BetaSignatureDelta { $type = 'signature_delta'; $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 of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Skill ID
Skill version or 'latest' for most recent version
enum BetaStopReason
class BetaSummarizeCompaction { $type = 'summarize'; $instructions; }
Replaces the server's default summarization prompt for this request. An empty or whitespace-only value counts as absent.
class BetaSystemMessageOutputConfig { $effort; }
?Effort effortHow much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
Valid values are low, medium, high, xhigh, or max.
class BetaSystemMessageParam { $role; $clearAt; $content; $outputConfig; }
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.
?BetaSystemMessageOutputConfig outputConfigPer-message output configuration on a role:"system" input message.
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; }
?list<BetaTextCitation> citationsCitations supporting the text block.
Citations supporting the text block.
The type of citation returned will depend on the type of document being cited. Citing a PDF results in page_location, plain text results in char_location, and content document results in content_block_location.
class BetaTextBlockParam { $type = 'text'; $text; $cacheControl; $citations; }
Create a cache control breakpoint at this content block.
class BetaTextCitation
class BetaTextCitationParam
class BetaTextDelta { $type = 'text_delta'; $text; }
class BetaTextEditorCodeExecutionCreateResultBlock { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
class BetaTextEditorCodeExecutionCreateResultBlockParam { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
class BetaTextEditorCodeExecutionStrReplaceResultBlock { $type = 'text_editor_code_execution_str_replace_result'; $lines; $newLines; /* 3 more */ }
class BetaTextEditorCodeExecutionStrReplaceResultBlockParam { $type = 'text_editor_code_execution_str_replace_result'; $lines; $newLines; /* 3 more */ }
class BetaTextEditorCodeExecutionToolResultBlock { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; }
class BetaTextEditorCodeExecutionToolResultBlockParam { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaTextEditorCodeExecutionToolResultError { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
class BetaTextEditorCodeExecutionToolResultErrorParam { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
class BetaTextEditorCodeExecutionViewResultBlock { $type = 'text_editor_code_execution_view_result'; $content; $fileType; /* 3 more */ }
class BetaTextEditorCodeExecutionViewResultBlockParam { $type = 'text_editor_code_execution_view_result'; $content; $fileType; /* 3 more */ }
class BetaThinkingBlock { $type = 'thinking'; $signature; $thinking; }
string signatureA value used to verify that this thinking block was generated by Claude when it is passed back to the API.
A value used to verify that this thinking block was generated by Claude when it is passed back to the API.
This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.
See extended thinking for details.
The text of Claude's thinking process for this block.
class BetaThinkingBlockBinding { $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; }
string signatureThe signature value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
The signature value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.
Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 invalid_request_error.
The thinking text of this block as returned by the API.
class BetaThinkingConfigAdaptive { $type = 'adaptive'; $blockBinding; $display; }
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.
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'; }
class BetaThinkingConfigDisabled { $type = 'disabled'; }
class BetaThinkingConfigEnabled { $type = 'enabled'; $budgetTokens; $blockBinding; $display; }
int budgetTokensDetermines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
Must be ≥1024 and less than max_tokens.
See extended thinking for details.
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.
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 BetaThinkingConfigParam
class BetaThinkingDelta { $type = 'thinking_delta'; $estimatedTokens; $thinking; }
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.
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; }
Always thinking_dropped for this entry type.
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.
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; }
Always thinking_mismatch_allowed for this entry type.
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.
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.
class BetaThinkingTurns { $type = 'thinking_turns'; $value; }
class BetaThreadContinueParams { $type = 'continue'; $previousMessageID; }
The id of the previous response in this Thread.
class BetaThreadCreateParams { $type = 'create'; }
class BetaTokenTaskBudget { $type = 'tokens'; $total; $remaining; }
The budget type. Currently only 'tokens' is supported.
Total token budget across all contexts in the session.
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 */ }
InputSchema inputSchemaJSON schema for this tool's input.
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 nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
?string descriptionDescription of what this tool does.
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.
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.
When true, guarantees schema validation on tool names and inputs
class BetaToolBash20241022 { $type = 'bash_20241022'; $name; $allowedCallers; /* 4 more */ }
"bash" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolBash20250124 { $type = 'bash_20250124'; $name; $allowedCallers; /* 4 more */ }
"bash" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolChangeMCPToolReference { $type = 'mcp_tool_reference'; $name; $serverName; }
class BetaToolChangeMCPToolsetReference { $type = 'mcp_toolset_reference'; $serverName; }
class BetaToolChangeToolDefinition { $type = 'tool_definition'; $definition; }
class BetaToolChangeToolDefinitionParam { $type = 'tool_definition'; $definition; }
class BetaToolChangeToolReference { $type = 'tool_reference'; $name; }
class BetaToolChoice
class BetaToolChoiceAny { $type = 'any'; $disableParallelToolUse; }
?bool disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
class BetaToolChoiceAuto { $type = 'auto'; $disableParallelToolUse; }
?bool disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output at most one tool use.
class BetaToolChoiceNone { $type = 'none'; }
class BetaToolChoiceTool { $type = 'tool'; $name; $disableParallelToolUse; }
The name of the tool to use.
?bool disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
class BetaToolComputerUse20241022 { $type = 'computer_20241022'; $displayHeightPx; $displayWidthPx; /* 7 more */ }
The height of the display in pixels.
The width of the display in pixels.
"computer" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
The X11 display number (e.g. 0, 1) for the display.
When true, guarantees schema validation on tool names and inputs
class BetaToolComputerUse20250124 { $type = 'computer_20250124'; $displayHeightPx; $displayWidthPx; /* 7 more */ }
The height of the display in pixels.
The width of the display in pixels.
"computer" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
The X11 display number (e.g. 0, 1) for the display.
When true, guarantees schema validation on tool names and inputs
class BetaToolComputerUse20251124 { $type = 'computer_20251124'; $displayHeightPx; $displayWidthPx; /* 8 more */ }
The height of the display in pixels.
The width of the display in pixels.
"computer" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
The X11 display number (e.g. 0, 1) for the display.
Whether to enable an action to take a zoomed-in screenshot of the screen.
When true, guarantees schema validation on tool names and inputs
class BetaToolReferenceBlock { $type = 'tool_reference'; $toolName; }
class BetaToolReferenceBlockParam { $type = 'tool_reference'; $toolName; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaToolResultBlockParam { $type = 'tool_result'; $toolUseID; $cacheControl; /* 3 more */ }
Create a cache control breakpoint at this content block.
For a toolset member tool_result, the toolset family of the paired tool_use.
class BetaToolSearchToolBm25_20251119 { $type; $name; $allowedCallers; /* 3 more */ }
"tool_search_tool_bm25" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolSearchToolRegex20251119 { $type; $name; $allowedCallers; /* 3 more */ }
"tool_search_tool_regex" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolSearchToolResultBlock { $type = 'tool_search_tool_result'; $content; $toolUseID; }
class BetaToolSearchToolResultBlockParam { $type = 'tool_search_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaToolSearchToolResultError { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
class BetaToolSearchToolResultErrorParam { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
class BetaToolSearchToolSearchResultBlock { $type = 'tool_search_tool_search_result'; $toolReferences; }
class BetaToolSearchToolSearchResultBlockParam { $type = 'tool_search_tool_search_result'; $toolReferences; }
class BetaToolTextEditor20241022 { $type = 'text_editor_20241022'; $name; $allowedCallers; /* 4 more */ }
"str_replace_editor" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolTextEditor20250124 { $type = 'text_editor_20250124'; $name; $allowedCallers; /* 4 more */ }
"str_replace_editor" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolTextEditor20250429 { $type = 'text_editor_20250429'; $name; $allowedCallers; /* 4 more */ }
"str_replace_based_edit_tool" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolTextEditor20250728 { $type = 'text_editor_20250728'; $name; $allowedCallers; /* 5 more */ }
"str_replace_based_edit_tool" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
When true, guarantees schema validation on tool names and inputs
class BetaToolUnion
class BetaToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
For a toolset member tool_use, the toolset family.
class BetaToolUseBlockParam { $type = 'tool_use'; $id; $input; /* 4 more */ }
Create a cache control breakpoint at this content block.
For a toolset member tool_use, the toolset family this member belongs to.
class BetaToolUseCaller
class BetaDirectCaller { $type = 'direct'; }
class BetaServerToolCaller { $type = 'code_execution_20250825'; $toolID; }
class BetaServerToolCaller20260120 { $type = 'code_execution_20260120'; $toolID; }
class BetaToolUsesKeep { $type = 'tool_uses'; $value; }
class BetaToolUsesTrigger { $type = 'tool_uses'; $value; }
class BetaToolsetToolUseBlock
class BetaBrowserToolUseBlock
class BetaComputerToolUseBlock
class BetaToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
For a toolset member tool_use, the toolset family.
class BetaURLImageSource { $type = 'url'; $url; }
class BetaURLPDFSource { $type = 'url'; $url; }
class BetaUsage { $cacheCreation; $cacheCreationInputTokens; $cacheReadInputTokens; /* 9 more */ }
class BetaUserLocation { $type = 'approximate'; $city; $country; /* 2 more */ }
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
class BetaUserMessageParam { $content; $role; }
class BetaWebFetchBlock { $type = 'web_fetch_result'; $content; $retrievedAt; $url; }
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class BetaWebFetchBlockParam { $type = 'web_fetch_result'; $content; $url; $retrievedAt; }
Fetched content URL
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; }
class BetaWebFetchToolResultBlockParam { $type = 'web_fetch_tool_result'; $content; $toolUseID; /* 2 more */ }
Create a cache control breakpoint at this content block.
class BetaWebFetchToolResultErrorBlock { $type = 'web_fetch_tool_result_error'; $errorCode; }
class BetaWebFetchToolResultErrorBlockParam { $type = 'web_fetch_tool_result_error'; $errorCode; }
class BetaWebFetchURLSourceAll { $type = 'all'; }
class BetaWebFetchURLSourceExcept { $type = 'except'; $tools; }
class BetaWebFetchURLSourceNone { $type = 'none'; }
class BetaWebFetchURLSourceOnly { $type = 'only'; $tools; }
class BetaWebFetchURLSourceToolReference { $type = 'tool_reference'; $name; }
class BetaWebFetchURLSources { $clientToolResults; $serverToolResults; $userInput; }
Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].
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.
Whether URLs in user messages are fetchable: "all" or "none".
class BetaWebSearchResultBlock { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
class BetaWebSearchResultBlockParam { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
class BetaWebSearchTool20250305 { $type = 'web_search_20250305'; $name; $allowedCallers; /* 7 more */ }
"web_search" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
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" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
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; }
class BetaWebSearchToolResultBlock { $type = 'web_search_tool_result'; $content; $toolUseID; $caller; }
class BetaWebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
class list<BetaWebSearchResultBlock> { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
class BetaWebSearchToolResultBlockParam { $type = 'web_search_tool_result'; $content; $toolUseID; /* 2 more */ }
Create a cache control breakpoint at this content block.
class list<BetaWebSearchResultBlockParam> { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
class BetaWebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
class BetaWebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
СообщенияПакеты
Создать пакет сообщений
$client->beta->messages->batches->create(list<Request> requests, ?list<AnthropicBeta> betas, ?string userProfileID, ?string workspaceID): MessageBatchОтправьте пакет запросов на создание сообщений.
Получить пакет сообщений
$client->beta->messages->batches->retrieve(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): MessageBatchЭта конечная точка идемпотентна и может использоваться для опроса завершения пакета сообщений. Чтобы получить доступ к результатам пакета сообщений, выполните запрос по адресу, указанному в поле results_url ответа.
Список пакетов сообщений
$client->beta->messages->batches->list(?string afterID, ?string beforeID, ?int limit, ?list<AnthropicBeta> betas, ?string workspaceID): Page<MessageBatch>Получите список всех пакетов сообщений в рабочем пространстве. Последние созданные пакеты возвращаются первыми.
Отменить пакет сообщений
$client->beta->messages->batches->cancel(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): MessageBatchПакеты можно отменить в любой момент до окончания обработки. После инициирования отмены пакет переходит в состояние canceling, в котором система может завершить все выполняющиеся непрерываемые запросы перед окончательной отменой.
Удалить пакет сообщений
$client->beta->messages->batches->delete(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): DeletedMessageBatchУдалите пакет сообщений.
Получить результаты пакета сообщений
$client->beta->messages->batches->resultsStream(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): BaseStream<MessageBatchIndividualResponse>Передаёт результаты пакета сообщений в потоковом режиме в виде файла .jsonl.