Messages
Create a Message
$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): BetaMessageSend a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
Count tokens in a Message
$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): BetaMessageTokensCountCount the number of tokens in a Message.
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.