Messages
Create a Message
client.Messages.New(ctx, params) (*Message, error)Send 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.Messages.CountTokens(ctx, params) (*MessageTokensCount, error)Count the number of tokens in a Message.
Models
type Base64ImageSource struct { Type: "base64"; Data; MediaType }
Data string
MediaType Base64ImageSourceMediaType
type Base64PDFSource struct { Type: "base64"; Data; MediaType }
Data string
type BashCodeExecutionOutputBlock struct { Type: "bash_code_execution_output"; FileID }
Type BashCodeExecutionOutput
type BashCodeExecutionOutputBlockParamResp struct { Type: "bash_code_execution_output"; FileID }
type BashCodeExecutionResultBlock struct { Type: "bash_code_execution_result"; Content; ReturnCode; /* 2 more */ }
Type BashCodeExecutionResult
Content []BashCodeExecutionOutputBlock
Type BashCodeExecutionOutput
type BashCodeExecutionResultBlockParamResp struct { Type: "bash_code_execution_result"; Content; ReturnCode; /* 2 more */ }
Content []BashCodeExecutionOutputBlockParamResp
type BashCodeExecutionToolResultBlock struct { Type: "bash_code_execution_tool_result"; Content; ToolUseID }
type BashCodeExecutionToolResultBlockParamResp struct { Type: "bash_code_execution_tool_result"; Content; ToolUseID; CacheControl }
type BashCodeExecutionToolResultError struct { Type: "bash_code_execution_tool_result_error"; ErrorCode }
Type BashCodeExecutionToolResultError
ErrorCode BashCodeExecutionToolResultErrorCode
type BashCodeExecutionToolResultErrorCode string
type BashCodeExecutionToolResultErrorParamResp struct { Type: "bash_code_execution_tool_result_error"; ErrorCode }
ErrorCode BashCodeExecutionToolResultErrorCode
type BrowserClickTargetUnion interface{…}Where to act: either a viewport coordinate or an element reference.
Where to act: either a viewport coordinate or an element reference.
type BrowserCoordinateTarget struct { Type: "coordinate"; X; Y }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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
type BrowserRefTarget struct { Type: "ref"; Ref }An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
type BrowserCloseTabConfig struct { DeferLoading; Enabled }close_tab's config overrides.
close_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserCloseTabInput struct { TabID }Close the tab with the given tab_id.
Close the tab with the given tab_id.
The tab to close.
type BrowserCloseTabToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserCoordinateTarget struct { Type: "coordinate"; X; Y }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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
type BrowserDoubleClickConfig struct { DeferLoading; Enabled }double_click's config overrides.
double_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserDoubleClickInput struct { Target; Modifiers; TabID }Double left-click at a viewport coordinate or on an element by reference.
Double left-click at a viewport coordinate or on an element by reference.
Target BrowserClickTargetUnionWhere to act: either a viewport coordinate or an element reference.
Where to act: either a viewport coordinate or an element reference.
type BrowserCoordinateTarget struct { Type: "coordinate"; X; Y }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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
type BrowserRefTarget struct { Type: "ref"; Ref }An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
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.
type BrowserDoubleClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserFileUploadConfig struct { DeferLoading; Enabled }file_upload's config overrides.
file_upload's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserFileUploadInput struct { Target; DocumentIDs; Paths; TabID }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.
Set the value of a file-input element to one or more files. The target must be an element reference; at least one of paths or document_ids is required.
Target BrowserRefTargetAn element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
DocumentIDs []string OptionalReferences to files the harness has staged, for deployments where the browser executor cannot read the caller's filesystem.
References to files the harness has staged, for deployments where the browser executor cannot read the caller's filesystem.
Paths []string OptionalFile paths on the browser executor's filesystem.
File paths on the browser executor's filesystem.
Tab to act on. Defaults to the active tab when omitted.
type BrowserFileUploadToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserFindConfig struct { DeferLoading; Enabled }find's config overrides.
find's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserFindInput struct { Query; TabID }Find elements matching a natural-language description (e.g. "search bar", "add to
cart button") and return up to 20 matches with element references.
Find elements matching a natural-language description (e.g. "search bar", "add to cart button") and return up to 20 matches with element references.
Natural-language description of the element(s) to find.
Tab to act on. Defaults to the active tab when omitted.
type BrowserFindToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserFormInputConfig struct { DeferLoading; Enabled }form_input's config overrides.
form_input's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserFormInputInput struct { Target; Value; TabID }Set the value of a form element (input, textarea, select, checkbox). Use a
boolean for checkboxes, an option value or text for selects.
Set the value of a form element (input, textarea, select, checkbox). Use a boolean for checkboxes, an option value or text for selects.
Target BrowserRefTargetAn element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
The value to set.
The value to set.
Tab to act on. Defaults to the active tab when omitted.
type BrowserFormInputToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserFormInputValueUnion interface{…}
type BrowserGetPageTextConfig struct { DeferLoading; Enabled }get_page_text's config overrides.
get_page_text's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserGetPageTextInput struct { TabID }Return the page's visible text content as plain text, prioritizing article
content. Suited to articles, documentation, and other text-heavy pages.
Return the page's visible text content as plain text, prioritizing article content. Suited to articles, documentation, and other text-heavy pages.
Tab to act on. Defaults to the active tab when omitted.
type BrowserGetPageTextToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserHoldKeyConfig struct { DeferLoading; Enabled }hold_key's config overrides.
hold_key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserHoldKeyInput struct { Duration; Text; TabID }Hold a key or key chord down for a duration, then release it. Uses the same key
names and "+" chord syntax as the key action.
Hold a key or key chord down for a duration, then release it. Uses the same key names and "+" chord syntax as the key action.
Duration float64Seconds to hold the key down (maximum 30).
Seconds to hold the key down (maximum 30).
The key or chord to hold.
Tab to act on. Defaults to the active tab when omitted.
type BrowserHoldKeyToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserHoverConfig struct { DeferLoading; Enabled }hover's config overrides.
hover's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserHoverInput struct { Target; TabID }Move the cursor to a coordinate or element without clicking.
Move the cursor to a coordinate or element without clicking.
Target BrowserClickTargetUnionWhere to act: either a viewport coordinate or an element reference.
Where to act: either a viewport coordinate or an element reference.
type BrowserCoordinateTarget struct { Type: "coordinate"; X; Y }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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
type BrowserRefTarget struct { Type: "ref"; Ref }An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
Tab to act on. Defaults to the active tab when omitted.
type BrowserHoverToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserJavascriptExecConfig struct { DeferLoading; Enabled }javascript_exec's config overrides.
javascript_exec's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserJavascriptExecInput struct { Text; TabID }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.
Execute JavaScript in the page context and return the value of the last
expression. The code runs with access to the DOM, window, and page variables.
Write the expression you want evaluated — do NOT use return.
JavaScript to execute in the page context.
Tab to act on. Defaults to the active tab when omitted.
type BrowserJavascriptExecToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserKeyConfig struct { DeferLoading; Enabled }key's config overrides.
key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserKeyInput struct { Text; Repeat; TabID }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.
Press a key or key chord. Use "+" to combine modifiers with a key (e.g. "ctrl+a", "cmd+shift+p") and space to sequence presses (e.g. "Backspace Backspace Delete"). Common names like "Return", "Tab", "Escape", "BackSpace" are supported.
The key, chord, or space-separated sequence to press.
Repeat int64 OptionalNumber of times to repeat. Default 1.
Number of times to repeat. Default 1.
Tab to act on. Defaults to the active tab when omitted.
type BrowserKeyToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserLeftClickConfig struct { DeferLoading; Enabled }left_click's config overrides.
left_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserLeftClickDragConfig struct { DeferLoading; Enabled }left_click_drag's config overrides.
left_click_drag's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserLeftClickDragInput struct { From; Target; TabID }Press at from, drag to target, release. Both must be coordinate targets.
Press at from, drag to target, release. Both must be coordinate targets.
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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Target BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Tab to act on. Defaults to the active tab when omitted.
type BrowserLeftClickDragToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserLeftClickInput struct { Target; Modifiers; TabID }Left-click at a viewport coordinate or on an element by reference.
Left-click at a viewport coordinate or on an element by reference.
Target BrowserClickTargetUnionWhere to act: either a viewport coordinate or an element reference.
Where to act: either a viewport coordinate or an element reference.
type BrowserCoordinateTarget struct { Type: "coordinate"; X; Y }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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
type BrowserRefTarget struct { Type: "ref"; Ref }An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
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.
type BrowserLeftClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserLeftMouseDownConfig struct { DeferLoading; Enabled }left_mouse_down's config overrides.
left_mouse_down's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserLeftMouseDownInput struct { Target; TabID }Press and hold the left mouse button at a viewport coordinate. Pair with
left_mouse_up to perform a custom drag.
Press and hold the left mouse button at a viewport coordinate. Pair with left_mouse_up to perform a custom drag.
Target BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Tab to act on. Defaults to the active tab when omitted.
type BrowserLeftMouseDownToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserLeftMouseUpConfig struct { DeferLoading; Enabled }left_mouse_up's config overrides.
left_mouse_up's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserLeftMouseUpInput struct { Target; TabID }Release the left mouse button at a viewport coordinate.
Release the left mouse button at a viewport coordinate.
Target BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Tab to act on. Defaults to the active tab when omitted.
type BrowserLeftMouseUpToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserListTabsConfig struct { DeferLoading; Enabled }list_tabs's config overrides.
list_tabs's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
List all open tabs with each tab's tab_id, title, and URL.
type BrowserListTabsToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserMiddleClickConfig struct { DeferLoading; Enabled }middle_click's config overrides.
middle_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserMiddleClickInput struct { Target; Modifiers; TabID }Middle-click at a viewport coordinate or on an element by reference.
Middle-click at a viewport coordinate or on an element by reference.
Target BrowserClickTargetUnionWhere to act: either a viewport coordinate or an element reference.
Where to act: either a viewport coordinate or an element reference.
type BrowserCoordinateTarget struct { Type: "coordinate"; X; Y }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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
type BrowserRefTarget struct { Type: "ref"; Ref }An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
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.
type BrowserMiddleClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserMouseMoveConfig struct { DeferLoading; Enabled }mouse_move's config overrides.
mouse_move's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserMouseMoveInput struct { Target; TabID }Move the pointer to a viewport coordinate without clicking.
Move the pointer to a viewport coordinate without clicking.
Target BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
Tab to act on. Defaults to the active tab when omitted.
type BrowserMouseMoveToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserNavigateConfig struct { DeferLoading; Enabled }navigate's config overrides.
navigate's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserNavigateInput struct { URL; TabID }Navigate to a URL, or go back/forward/reload in history. The protocol may be
omitted (defaults to https://).
Navigate to a URL, or go back/forward/reload in history. The protocol may be omitted (defaults to https://).
The URL to navigate to, or "back" / "forward" / "reload" for history navigation.
Tab to act on. Defaults to the active tab when omitted.
type BrowserNavigateToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserNewTabConfig struct { DeferLoading; Enabled }new_tab's config overrides.
new_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
Open a new empty tab and return its tab_id.
type BrowserNewTabToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserReadConsoleConfig struct { DeferLoading; Enabled }read_console's config overrides.
read_console's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserReadConsoleInput struct { TabID }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.
Return console output (log entries, errors, warnings) accumulated since the driver attached to the tab and since the last read, one line per entry. An empty result does not mean no traffic for a tab that predates attach.
Tab to act on. Defaults to the active tab when omitted.
type BrowserReadConsoleToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserReadNetworkConfig struct { DeferLoading; Enabled }read_network's config overrides.
read_network's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserReadNetworkInput struct { TabID }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.
Return the network requests (method, URL, status, MIME type, timing) recorded since the driver attached to the tab and since the last read, one line per entry. An empty result does not mean no traffic for a tab that predates attach.
Tab to act on. Defaults to the active tab when omitted.
type BrowserReadNetworkToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserReadPageConfig struct { DeferLoading; Enabled }read_page's config overrides.
read_page's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserReadPageFilter string
type BrowserReadPageInput struct { Depth; Filter; Ref; TabID }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.
Return a structured accessibility tree of the page (or the subtree rooted at
ref), with element references like [ref_7] that can be used as targets on later
actions. Output is capped at 50,000 characters — narrow with ref or a smaller
depth when exceeded.
Depth int64 OptionalMaximum tree depth. Default 15.
Maximum tree depth. Default 15.
Filter BrowserReadPageFilter OptionalWhich elements to include. Omitted: every visible element. "interactive": interactive elements only. "all": additionally includes off-viewport elements.
Which elements to include. Omitted: every visible element. "interactive": interactive elements only. "all": additionally includes off-viewport elements.
Element reference to read a subtree from. Omit to read from the page root.
Tab to act on. Defaults to the active tab when omitted.
type BrowserReadPageToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserRefTarget struct { Type: "ref"; Ref }An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
type BrowserRightClickConfig struct { DeferLoading; Enabled }right_click's config overrides.
right_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserRightClickInput struct { Target; Modifiers; TabID }Right-click at a viewport coordinate or on an element by reference.
Right-click at a viewport coordinate or on an element by reference.
Target BrowserClickTargetUnionWhere to act: either a viewport coordinate or an element reference.
Where to act: either a viewport coordinate or an element reference.
type BrowserCoordinateTarget struct { Type: "coordinate"; X; Y }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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
type BrowserRefTarget struct { Type: "ref"; Ref }An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
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.
type BrowserRightClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserScreenshotConfig struct { DeferLoading; Enabled }screenshot's config overrides.
screenshot's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserScreenshotInput struct { TabID }Capture the current browser viewport.
Capture the current browser viewport.
Tab to act on. Defaults to the active tab when omitted.
type BrowserScreenshotToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserScrollConfig struct { DeferLoading; Enabled }scroll's config overrides.
scroll's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserScrollDirection string
type BrowserScrollInput struct { ScrollDirection; Target; ScrollAmount; TabID }Scroll at a viewport position. target must be a coordinate target.
Scroll at a viewport position. target must be a coordinate target.
ScrollDirection BrowserScrollDirection
Target BrowserCoordinateTargetA point in the browser viewport, in viewport pixels (the same frame as a
full-viewport screenshot).
A point in the browser viewport, in viewport pixels (the same frame as a full-viewport screenshot).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
ScrollAmount int64 OptionalScroll-wheel notches (1–10). Default 3.
Scroll-wheel notches (1–10). Default 3.
Tab to act on. Defaults to the active tab when omitted.
type BrowserScrollToConfig struct { DeferLoading; Enabled }scroll_to's config overrides.
scroll_to's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserScrollToInput struct { Target; TabID }Scroll an element into view.
Scroll an element into view.
Target BrowserRefTargetAn element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
Tab to act on. Defaults to the active tab when omitted.
type BrowserScrollToToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserScrollToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserStateBlockParamResp struct { Type: "browser_state"; Tabs; CacheControl; StateChanges }The caller's browser state after a browser toolset member call —
the full inventory of open tabs, which tab is active, and any side
effects (tabs opened, download state changes) the call produced.
The caller's browser state after a browser toolset member call — the full inventory of open tabs, which tab is active, and any side effects (tabs opened, download state changes) the call produced.
At most one per tool_result, only on a non-error result answering a
browser toolset member tool_use. The server renders the
model-visible text from it; the model never sees the raw fields.
type BrowserStateChangeUnion interface{…}
type BrowserStateChangeDownloadCompleted struct { Type: "download_completed"; DownloadID; URL; /* 2 more */ }A file download that finished during this call, reported with the
same download_id as its download_started — or without a prior
download_started, when the download finished during the call that
started it (at most one state change per download_id per result).
A file download that finished during this call, reported with the
same download_id as its download_started — or without a prior
download_started, when the download finished during the call that
started it (at most one state change per download_id per result).
DownloadID stringThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
URL stringThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
Path string OptionalWhere the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
SizeBytes int64 OptionalThe completed download's size.
The completed download's size.
type BrowserStateChangeDownloadFailed struct { Type: "download_failed"; DownloadID; URL; Error }A file download that failed — or was cancelled — during this call.
A file download that failed — or was cancelled — during this call.
DownloadID stringThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
URL stringThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
Error string OptionalThe failure or cancellation detail, when known.
The failure or cancellation detail, when known.
type BrowserStateChangeDownloadStarted struct { Type: "download_started"; DownloadID; URL }A file download that started during this call.
A file download that started during this call.
DownloadID stringThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
URL stringThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
type BrowserStateChangeTabOpened struct { Type: "tab_opened"; TabID }A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
Carries only the tab_id; the tab's title and url live on its
tabs entry, which must include the same tab_id. A tab opened
during a failed call gets no deferred tab_opened; it simply appears
in the next result's tabs inventory.
TabID stringThe tab_id of the opened tab, present in tabs.
The tab_id of the opened tab, present in tabs.
type BrowserStateTabEntry struct { TabID; Title; URL; Active }One open browser tab reported in a browser_state block's tabs
inventory.
One open browser tab reported in a browser_state block's tabs
inventory.
tab_id is the caller-assigned identifier for the tab; title and
url describe the page the tab is currently showing and may be empty
strings (a blank tab legitimately has both empty). active marks the
tab that is active after this call; whenever tabs is non-empty,
exactly one entry is marked.
TabID stringThe caller-assigned identifier for this tab, unique within the inventory.
The caller-assigned identifier for this tab, unique within the inventory.
Title stringThe title of the page the tab is showing. May be empty.
The title of the page the tab is showing. May be empty.
URL stringThe URL of the page the tab is showing. May be empty.
The URL of the page the tab is showing. May be empty.
Whether this tab is the active tab after this call. Whenever tabs is non-empty, exactly one entry is marked active: true.
type BrowserSwitchTabConfig struct { DeferLoading; Enabled }switch_tab's config overrides.
switch_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserSwitchTabInput struct { TabID }Make the tab with the given tab_id the active tab — the tab that actions without
a tab_id apply to.
Make the tab with the given tab_id the active tab — the tab that actions without a tab_id apply to.
The tab to switch to.
type BrowserSwitchTabToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserToolUseBlockUnion interface{…}
type BrowserToolset20260801 struct { Type: "browser_toolset_20260801"; CacheControl; Configs }The browser toolset: a single tools[] entry (carrying no
name) that declares the browser tool family. The model is served
the family's tool with any members disabled via configs removed
from its schema.
The browser toolset: a single tools[] entry (carrying no
name) that declares the browser tool family. The model is served
the family's tool with any members disabled via configs removed
from its schema.
CacheControl CacheControlEphemeral OptionalCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
TTL CacheControlEphemeralTTL OptionalThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
Configs BrowserToolsetConfigs OptionalSparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
type BrowserToolsetConfigs struct { Type; CloseTab; DoubleClick; /* 28 more */ }Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
type BrowserTripleClickConfig struct { DeferLoading; Enabled }triple_click's config overrides.
triple_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserTripleClickInput struct { Target; Modifiers; TabID }Triple left-click at a viewport coordinate or on an element by reference
(typically selects a line or paragraph).
Triple left-click at a viewport coordinate or on an element by reference (typically selects a line or paragraph).
Target BrowserClickTargetUnionWhere to act: either a viewport coordinate or an element reference.
Where to act: either a viewport coordinate or an element reference.
type BrowserCoordinateTarget struct { Type: "coordinate"; X; Y }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).
X int64Pixels from the left edge of the viewport.
Pixels from the left edge of the viewport.
Y int64Pixels from the top edge of the viewport.
Pixels from the top edge of the viewport.
type BrowserRefTarget struct { Type: "ref"; Ref }An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element on the page, identified by a reference from a prior read_page or
find result. References are scoped to the tab that produced them and become
stale after navigation or a major re-render.
An element reference (e.g. "ref_7") returned by a prior read_page or find result.
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.
type BrowserTripleClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserTypeConfig struct { DeferLoading; Enabled }type's config overrides.
type's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserTypeInput struct { Text; TabID }Type a literal string at the current focus.
Type a literal string at the current focus.
The text to type.
Tab to act on. Defaults to the active tab when omitted.
type BrowserTypeToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserWaitConfig struct { DeferLoading; Enabled }wait's config overrides.
wait's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserWaitInput struct { Duration; TabID }Pause for the given duration.
Pause for the given duration.
Duration float64Seconds to wait (maximum 30).
Seconds to wait (maximum 30).
Tab to act on. Defaults to the active tab when omitted.
type BrowserWaitToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type BrowserZoomConfig struct { DeferLoading; Enabled }zoom's config overrides.
zoom's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type BrowserZoomInput struct { Region; TabID }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.
Return a cropped screenshot of the given viewport region, scaled up for closer inspection — useful for small icons, buttons, or text. Coordinates are in the same viewport-pixel space as a full screenshot.
Region []int64[x0, y0, x1, y1] in viewport pixels.
[x0, y0, x1, y1] in viewport pixels.
Tab to act on. Defaults to the active tab when omitted.
type BrowserZoomToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type CacheControlEphemeral struct { Type: "ephemeral"; TTL }
TTL CacheControlEphemeralTTL OptionalThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
type CacheCreation struct { Ephemeral1hInputTokens; Ephemeral5mInputTokens }
Ephemeral1hInputTokens int64The number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 1 hour cache entry.
Ephemeral5mInputTokens int64The number of input tokens used to create the 5 minute cache entry.
The number of input tokens used to create the 5 minute cache entry.
type CacheMissMessagesChanged struct { Type: "messages_changed"; CacheMissedInputTokens }
Type MessagesChanged
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
type CacheMissModelChanged struct { Type: "model_changed"; CacheMissedInputTokens }
Type ModelChanged
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
type CacheMissPreviousMessageNotFound struct { Type: "previous_message_not_found" }
Type PreviousMessageNotFound
type CacheMissReasonUnion interface{…}
type CacheMissSystemChanged struct { Type: "system_changed"; CacheMissedInputTokens }
Type SystemChanged
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
type CacheMissToolsChanged struct { Type: "tools_changed"; CacheMissedInputTokens }
Type ToolsChanged
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
type CacheMissUnavailable struct { Type: "unavailable" }
Type Unavailable
type CitationCharLocation struct { Type: "char_location"; CitedText; DocumentIndex; /* 4 more */ }
Type CharLocation
DocumentIndex int64
StartCharIndex int64
type CitationCharLocationParamResp struct { Type: "char_location"; CitedText; DocumentIndex; /* 3 more */ }
DocumentIndex int64
DocumentTitle string
StartCharIndex int64
type CitationContentBlockLocation struct { Type: "content_block_location"; CitedText; DocumentIndex; /* 4 more */ }
Type ContentBlockLocation
CitedText stringThe 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.
DocumentIndex int64
EndBlockIndex int64Exclusive 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.
StartBlockIndex int640-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
type CitationContentBlockLocationParamResp struct { Type: "content_block_location"; CitedText; DocumentIndex; /* 3 more */ }
CitedText stringThe 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.
DocumentIndex int64
DocumentTitle string
EndBlockIndex int64Exclusive 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.
StartBlockIndex int640-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
type CitationPageLocation struct { Type: "page_location"; CitedText; DocumentIndex; /* 4 more */ }
Type PageLocation
DocumentIndex int64
StartPageNumber int64
type CitationPageLocationParamResp struct { Type: "page_location"; CitedText; DocumentIndex; /* 3 more */ }
DocumentIndex int64
DocumentTitle string
StartPageNumber int64
type CitationSearchResultLocationParamResp struct { Type: "search_result_location"; CitedText; EndBlockIndex; /* 4 more */ }
CitedText stringThe 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.
EndBlockIndex int64Exclusive 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.
SearchResultIndex int640-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.
StartBlockIndex int640-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
type CitationWebSearchResultLocationParamResp struct { Type: "web_search_result_location"; CitedText; EncryptedIndex; /* 2 more */ }
Title string
URL string
type CitationsConfig struct { Enabled }
Enabled bool
type CitationsConfigParamResp struct { Enabled }
type CitationsDelta struct { Type: "citations_delta"; Citation }
type CitationsSearchResultLocation struct { Type: "search_result_location"; CitedText; EndBlockIndex; /* 4 more */ }
Type SearchResultLocation
CitedText stringThe 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.
EndBlockIndex int64Exclusive 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.
SearchResultIndex int640-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.
StartBlockIndex int640-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
type CitationsWebSearchResultLocation struct { Type: "web_search_result_location"; CitedText; EncryptedIndex; /* 2 more */ }
Type WebSearchResultLocation
Title string
type CodeExecutionOutputBlock struct { Type: "code_execution_output"; FileID }
Type CodeExecutionOutput
type CodeExecutionOutputBlockParamResp struct { Type: "code_execution_output"; FileID }
type CodeExecutionResultBlock struct { Type: "code_execution_result"; Content; ReturnCode; /* 2 more */ }
Type CodeExecutionResult
Content []CodeExecutionOutputBlock
Type CodeExecutionOutput
type CodeExecutionResultBlockParamResp struct { Type: "code_execution_result"; Content; ReturnCode; /* 2 more */ }
Content []CodeExecutionOutputBlockParamResp
type CodeExecutionTool20250522 struct { Type: "code_execution_20250522"; Name; AllowedCallers; /* 3 more */ }
type CodeExecutionTool20250825 struct { Type: "code_execution_20250825"; Name; AllowedCallers; /* 3 more */ }
type CodeExecutionTool20260120 struct { Type: "code_execution_20260120"; Name; AllowedCallers; /* 3 more */ }Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
type CodeExecutionTool20260521 struct { Type: "code_execution_20260521"; Name; AllowedCallers; /* 3 more */ }Code execution tool with REPL state persistence.
Code execution tool with REPL state persistence.
type CodeExecutionToolResultBlock struct { Type: "code_execution_tool_result"; Content; ToolUseID }
Type CodeExecutionToolResult
ToolUseID string
type CodeExecutionToolResultBlockContentUnion interface{…}
type CodeExecutionToolResultBlockParamResp struct { Type: "code_execution_tool_result"; Content; ToolUseID; CacheControl }
ToolUseID string
CacheControl CacheControlEphemeral OptionalCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
TTL CacheControlEphemeralTTL OptionalThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
type CodeExecutionToolResultBlockParamContentUnionResp interface{…}
type CodeExecutionToolResultError struct { Type: "code_execution_tool_result_error"; ErrorCode }
Type CodeExecutionToolResultError
ErrorCode CodeExecutionToolResultErrorCode
type CodeExecutionToolResultErrorCode string
type CodeExecutionToolResultErrorParamResp struct { Type: "code_execution_tool_result_error"; ErrorCode }
ErrorCode CodeExecutionToolResultErrorCode
type ComputerCursorPositionConfig struct { DeferLoading; Enabled }cursor_position's config overrides.
cursor_position's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
Get the current (x, y) pixel coordinate of the cursor.
type ComputerCursorPositionToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerDoubleClickConfig struct { DeferLoading; Enabled }double_click's config overrides.
double_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerDoubleClickInput struct { Coordinate; Text }Double-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
Double-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
Coordinate []int64 Optional(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").
type ComputerDoubleClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerHoldKeyConfig struct { DeferLoading; Enabled }hold_key's config overrides.
hold_key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerHoldKeyInput struct { Duration; Text }Hold down a key or key-combination for a specified duration. Uses the same key
syntax as key.
Hold down a key or key-combination for a specified duration. Uses the same key
syntax as key.
Duration int64Duration to hold the key, in seconds.
Duration to hold the key, in seconds.
The key or key-combination to hold.
type ComputerHoldKeyToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerKeyConfig struct { DeferLoading; Enabled }key's config overrides.
key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerKeyInput struct { Text; Repeat }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.
Press a key or key-combination on the keyboard. Use "+" to combine modifiers with a key (e.g. "ctrl+s", "alt+Tab", "ctrl+shift+Escape"). Key names are case-insensitive; common names like "Return", "Tab", "Escape", "Up", "Down", "Left", "Right", "Home", "End", "Page_Up", "Page_Down", "Delete", "BackSpace" are supported.
The key or key-combination to press.
Repeat int64 OptionalNumber of times to repeat the key press. Default is 1.
Number of times to repeat the key press. Default is 1.
type ComputerKeyToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerLeftClickConfig struct { DeferLoading; Enabled }left_click's config overrides.
left_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerLeftClickDragConfig struct { DeferLoading; Enabled }left_click_drag's config overrides.
left_click_drag's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerLeftClickDragInput struct { Coordinate; StartCoordinate; Text }Click and drag the cursor from start_coordinate to coordinate.
Click and drag the cursor from start_coordinate to coordinate.
Coordinate []int64(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.
StartCoordinate []int64(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").
type ComputerLeftClickDragToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerLeftClickInput struct { Coordinate; Text }Click the left mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Click the left mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Coordinate []int64 Optional(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").
type ComputerLeftClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerLeftMouseDownConfig struct { DeferLoading; Enabled }left_mouse_down's config overrides.
left_mouse_down's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
Press and hold the left mouse button at the current cursor position.
type ComputerLeftMouseDownToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerLeftMouseUpConfig struct { DeferLoading; Enabled }left_mouse_up's config overrides.
left_mouse_up's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
Release the left mouse button.
type ComputerLeftMouseUpToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerMiddleClickConfig struct { DeferLoading; Enabled }middle_click's config overrides.
middle_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerMiddleClickInput struct { Coordinate; Text }Click the middle mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Click the middle mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Coordinate []int64 Optional(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").
type ComputerMiddleClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerMouseMoveConfig struct { DeferLoading; Enabled }mouse_move's config overrides.
mouse_move's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerMouseMoveInput struct { Coordinate }Move the cursor to a specified (x, y) pixel coordinate. Use this ONLY to hover
without clicking; otherwise use a click action directly.
Move the cursor to a specified (x, y) pixel coordinate. Use this ONLY to hover without clicking; otherwise use a click action directly.
Coordinate []int64(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.
type ComputerMouseMoveToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerRightClickConfig struct { DeferLoading; Enabled }right_click's config overrides.
right_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerRightClickInput struct { Coordinate; Text }Click the right mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Click the right mouse button at the specified (x, y) pixel coordinate, or the
current cursor position if coordinate is omitted.
Coordinate []int64 Optional(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").
type ComputerRightClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerScreenshotConfig struct { DeferLoading; Enabled }screenshot's config overrides.
screenshot's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
Take a screenshot of the screen.
type ComputerScreenshotToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerScrollConfig struct { DeferLoading; Enabled }scroll's config overrides.
scroll's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerScrollDirection string
type ComputerScrollInput struct { ScrollAmount; ScrollDirection; Coordinate; Text }Scroll the screen at the specified (x, y) pixel coordinate, or the current cursor
position if coordinate is omitted. Do NOT use PageUp/PageDown to scroll.
Scroll the screen at the specified (x, y) pixel coordinate, or the current cursor
position if coordinate is omitted. Do NOT use PageUp/PageDown to scroll.
Number of 'clicks' of the scroll wheel.
ScrollDirection ComputerScrollDirection
Coordinate []int64 Optional(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").
type ComputerScrollToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerToolUseBlockUnion interface{…}
type ComputerToolset20260801 struct { Type: "computer_toolset_20260801"; CacheControl; Configs }The computer toolset: a single tools[] entry (carrying no
name) that declares the computer tool family. The model is
served the family's tool with any members disabled via configs
removed from its schema. Every member is enabled by default, zoom
included. The single-tool options display_number and
enable_zoom are not fields of a toolset entry — it carries only
type, configs, and cache_control; zoom is controlled
via configs.zoom.enabled.
The computer toolset: a single tools[] entry (carrying no
name) that declares the computer tool family. The model is
served the family's tool with any members disabled via configs
removed from its schema. Every member is enabled by default, zoom
included. The single-tool options display_number and
enable_zoom are not fields of a toolset entry — it carries only
type, configs, and cache_control; zoom is controlled
via configs.zoom.enabled.
CacheControl CacheControlEphemeral OptionalCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
TTL CacheControlEphemeralTTL OptionalThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
Configs ComputerToolsetConfigs OptionalSparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
type ComputerToolsetConfigs struct { Type; CursorPosition; DoubleClick; /* 14 more */ }Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
type ComputerTripleClickConfig struct { DeferLoading; Enabled }triple_click's config overrides.
triple_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerTripleClickInput struct { Coordinate; Text }Triple-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
Triple-click the left mouse button at the specified (x, y) pixel coordinate, or
the current cursor position if coordinate is omitted.
Coordinate []int64 Optional(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").
type ComputerTripleClickToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerTypeConfig struct { DeferLoading; Enabled }type's config overrides.
type's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerTypeInput struct { Text }Type a string of text on the keyboard.
Type a string of text on the keyboard.
The text to type.
type ComputerTypeToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerWaitConfig struct { DeferLoading; Enabled }wait's config overrides.
wait's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerWaitInput struct { Duration }Wait for a specified duration.
Wait for a specified duration.
Duration int64Duration to wait, in seconds.
Duration to wait, in seconds.
type ComputerWaitToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ComputerZoomConfig struct { DeferLoading; Enabled }zoom's config overrides.
zoom's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.
type ComputerZoomInput struct { Region }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.
Take a screenshot of a rectangular region. Region coordinates are in the full-screenshot space (not physical display pixels). The crop is scaled up to fill the image budget so fine details become legible.
Region []int64(x0, y0, x1, y1): The region to capture.
(x0, y0, x1, y1): The region to capture.
type ComputerZoomToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type Container struct { ID; ExpiresAt; Skills }Information about the container used in the request (for the code execution tool)
Information about the container used in the request (for the code execution tool)
Identifier for the container used in this request
ExpiresAt TimeThe time at which the container will expire.
The time at which the container will expire.
Skills []ContainerSkillSkills loaded in the container
Skills loaded in the container
Type ContainerSkillTypeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
SkillID stringSkill ID
Skill ID
Version stringThe resolved version: a skill version ID for custom skills.
The resolved version: a skill version ID for custom skills.
type ContainerParamsResp struct { ID; Skills }Container parameters with skills to be loaded.
Container parameters with skills to be loaded.
Container id
Skills []SkillParamsResp OptionalList of skills to load in the container
List of skills to load in the container
Type SkillParamsTypeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
SkillID stringSkill ID
Skill ID
Version string OptionalSkill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
type ContainerSkill struct { Type; SkillID; Version }A skill that was loaded in a container (response model).
A skill that was loaded in a container (response model).
Type ContainerSkillTypeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
SkillID stringSkill ID
Skill ID
Version stringThe resolved version: a skill version ID for custom skills.
The resolved version: a skill version ID for custom skills.
type ContainerUploadBlock struct { Type: "container_upload"; FileID }Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
Type ContainerUpload
type ContainerUploadBlockParamResp struct { Type: "container_upload"; FileID; CacheControl }A content block that represents a file to be uploaded to the container
Files uploaded via this block will be available in the container's input directory.
A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory.
CacheControl CacheControlEphemeral OptionalCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
TTL CacheControlEphemeralTTL OptionalThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
type ContentBlockUnion interface{…}
type ContentBlockParamUnionResp interface{…}
type ContentBlockSource struct { Type: "content"; Content }
Content ContentBlockSourceContentUnion
type TextBlockParamResp struct { Type: "text"; Text; CacheControl; Citations }
type ImageBlockParamResp struct { Type: "image"; Source; CacheControl; Transformations }
type ContentBlockSourceContentItemUnion interface{…}
type TextBlockParamResp struct { Type: "text"; Text; CacheControl; Citations }
type ImageBlockParamResp struct { Type: "image"; Source; CacheControl; Transformations }
type Diagnostics struct { CacheMissReason }Request-level diagnostics: why the prompt cache could not fully reuse
the prefix of the request named by diagnostics.previous_message_id.
Request-level diagnostics: why the prompt cache could not fully reuse
the prefix of the request named by diagnostics.previous_message_id.
CacheMissReason CacheMissReasonUnionExplains why the prompt cache could not fully reuse the prefix from the request identified by diagnostics.previous_message_id. null means diagnosis is still pending — the response was serialized before the background comparison completed.
Explains why the prompt cache could not fully reuse the prefix from the request identified by diagnostics.previous_message_id. null means diagnosis is still pending — the response was serialized before the background comparison completed.
type DiagnosticsParamResp struct { PreviousMessageID }Request-level diagnostics. Currently carries the previous response
id for prompt-cache divergence reporting.
Request-level diagnostics. Currently carries the previous response id for prompt-cache divergence reporting.
PreviousMessageID string OptionalThe id (msg_...) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns diagnostics.cache_miss_reason when the prompt-cache prefix could not be reused. Pass null on the first turn to opt in without a prior message to compare.
The id (msg_...) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns diagnostics.cache_miss_reason when the prompt-cache prefix could not be reused. Pass null on the first turn to opt in without a prior message to compare.
type DirectCaller struct { Type: "direct" }Tool invocation directly from the model.
Tool invocation directly from the model.
type DocumentBlock struct { Type: "document"; Citations; Source; Title }
type DocumentBlockParamResp struct { Type: "document"; Source; CacheControl; /* 3 more */ }
type EncryptedCodeExecutionResultBlock struct { Type: "encrypted_code_execution_result"; Content; EncryptedStdout; /* 2 more */ }Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
Type EncryptedCodeExecutionResult
Content []CodeExecutionOutputBlock
Type CodeExecutionOutput
type EncryptedCodeExecutionResultBlockParamResp struct { Type: "encrypted_code_execution_result"; Content; EncryptedStdout; /* 2 more */ }Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
Content []CodeExecutionOutputBlockParamResp
type FileDocumentSource struct { Type: "file"; FileID }
type FileImageSource struct { Type: "file"; FileID }
type ImageBlockParamResp struct { Type: "image"; Source; CacheControl; Transformations }
type ImageTransformationsParamResp struct { OversizedImage }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.
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.
OversizedImage ImageTransformationsParamOversizedImage OptionalWhat the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
What the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
type InputJSONDelta struct { Type: "input_json_delta"; PartialJSON }
Type InputJSONDelta
type JSONOutputFormat struct { Type: "json_schema"; Schema }
The JSON schema of the format
type MemoryTool20250818 struct { Type: "memory_20250818"; Name; AllowedCallers; /* 4 more */ }
type Message struct { Type: "message"; ID; Container; /* 8 more */ }
type MessageCountTokensToolUnion interface{…}
type MessageCreateParamsContainerUnionResp interface{…}Container identifier for reuse across requests.
Container identifier for reuse across requests.
type ContainerParamsResp struct { ID; Skills }Container parameters with skills to be loaded.
Container parameters with skills to be loaded.
Container id
Skills []SkillParamsResp OptionalList of skills to load in the container
List of skills to load in the container
Type SkillParamsTypeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
SkillID stringSkill ID
Skill ID
Version string OptionalSkill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
type MessageDeltaUsage struct { CacheCreationInputTokens; CacheReadInputTokens; InputTokens; /* 3 more */ }
CacheCreationInputTokens int64The cumulative number of input tokens used to create the cache entry.
The cumulative number of input tokens used to create the cache entry.
CacheReadInputTokens int64The cumulative number of input tokens read from the cache.
The cumulative number of input tokens read from the cache.
InputTokens int64The cumulative number of input tokens which were used.
The cumulative number of input tokens which were used.
The cumulative number of output tokens which were used.
OutputTokensDetails 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.
ThinkingTokens int64Number 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. Computed by
re-tokenizing the raw reasoning text, so 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.
ServerToolUse ServerToolUsageThe number of server tool requests.
The number of server tool requests.
WebFetchRequests int64The number of web fetch tool requests.
The number of web fetch tool requests.
WebSearchRequests int64The number of web search tool requests.
The number of web search tool requests.
type MessageParamResp struct { Content; Role }
type MessageTokensCount struct { InputTokens }
The total number of tokens across the provided list of messages, system prompt, and tools.
type Metadata struct { UserID }
UserID string OptionalAn external identifier for the user who is associated with the request.
An external identifier for the user who is associated with the request.
This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
type Model stringThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
type OutputConfig struct { Effort; Format }
Effort OutputConfigEffort OptionalHow much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
Valid values are low, medium, high, xhigh, or max.
Format JSONOutputFormat OptionalA schema to specify Claude's output format in responses. See structured outputs
A schema to specify Claude's output format in responses. See structured outputs
The JSON schema of the format
type OutputTokensDetails struct { ThinkingTokens }
ThinkingTokens int64Number 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. Computed by
re-tokenizing the raw reasoning text, so 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.
type PlainTextSource struct { Type: "text"; Data; MediaType }
type RawContentBlockDeltaUnion interface{…}
type ContentBlockDeltaEvent struct { Type: "content_block_delta"; Delta; Index }
Type ContentBlockDelta
type ContentBlockStartEvent struct { Type: "content_block_start"; ContentBlock; Index }
type ContentBlockStopEvent struct { Type: "content_block_stop"; Index }
Type ContentBlockStop
type MessageDeltaEvent struct { Type: "message_delta"; Delta; Usage }
type MessageStartEvent struct { Type: "message_start"; Message }
Type MessageStart
Message Message
type MessageStopEvent struct { Type: "message_stop" }
Type MessageStop
type MessageStreamEventUnion interface{…}
type RedactedThinkingBlock struct { Type: "redacted_thinking"; Data }
Type RedactedThinking
Data stringThe 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.
type RedactedThinkingBlockParamResp struct { 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.
type RefusalStopDetails struct { Type: "refusal"; Category; Explanation }Structured information about a refusal.
Structured information about a refusal.
Type Refusal
Category RefusalStopDetailsCategoryThe policy category that triggered the refusal.
The policy category that triggered the refusal.
null when the refusal doesn't map to a named category.
The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.
The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.
The request could assist the development of competing AI models, which is restricted under Anthropic's commercial terms. Benign machine learning work can also trigger this category.
The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use adaptive thinking.
The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
Explanation stringHuman-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.
type SearchResultBlockParamResp struct { Type: "search_result"; Content; Source; /* 3 more */ }
type ServerToolCaller struct { Type: "code_execution_20250825"; ToolID }Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ToolID string
type ServerToolCaller20260120 struct { Type: "code_execution_20260120"; ToolID }
ToolID string
type ServerToolUsage struct { WebFetchRequests; WebSearchRequests }
WebFetchRequests int64The number of web fetch tool requests.
The number of web fetch tool requests.
WebSearchRequests int64The number of web search tool requests.
The number of web search tool requests.
type ServerToolUseBlock struct { Type: "server_tool_use"; ID; Caller; /* 2 more */ }
type ServerToolUseBlockParamResp struct { Type: "server_tool_use"; ID; Input; /* 3 more */ }
type SignatureDelta struct { Type: "signature_delta"; Signature }
Type SignatureDelta
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.
type SkillParamsResp struct { Type; SkillID; Version }Specification for a skill to be loaded in a container (request model).
Specification for a skill to be loaded in a container (request model).
Type SkillParamsTypeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
SkillID stringSkill ID
Skill ID
Version string OptionalSkill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
type StopReason string
type TextBlock struct { Type: "text"; Citations; Text }
type TextBlockParamResp struct { Type: "text"; Text; CacheControl; Citations }
type TextCitationUnion interface{…}
type TextCitationParamUnionResp interface{…}
type TextDelta struct { Type: "text_delta"; Text }
Type TextDelta
type TextEditorCodeExecutionCreateResultBlock struct { Type: "text_editor_code_execution_create_result"; IsFileUpdate }
Type TextEditorCodeExecutionCreateResult
type TextEditorCodeExecutionCreateResultBlockParamResp struct { Type: "text_editor_code_execution_create_result"; IsFileUpdate }
type TextEditorCodeExecutionStrReplaceResultBlock struct { Type: "text_editor_code_execution_str_replace_result"; Lines; NewLines; /* 3 more */ }
Type TextEditorCodeExecutionStrReplaceResult
type TextEditorCodeExecutionStrReplaceResultBlockParamResp struct { Type: "text_editor_code_execution_str_replace_result"; Lines; NewLines; /* 3 more */ }
type TextEditorCodeExecutionToolResultBlock struct { Type: "text_editor_code_execution_tool_result"; Content; ToolUseID }
type TextEditorCodeExecutionToolResultBlockParamResp struct { Type: "text_editor_code_execution_tool_result"; Content; ToolUseID; CacheControl }
type TextEditorCodeExecutionToolResultError struct { Type: "text_editor_code_execution_tool_result_error"; ErrorCode; ErrorMessage }
Type TextEditorCodeExecutionToolResultError
type TextEditorCodeExecutionToolResultErrorCode string
type TextEditorCodeExecutionToolResultErrorParamResp struct { Type: "text_editor_code_execution_tool_result_error"; ErrorCode; ErrorMessage }
type TextEditorCodeExecutionViewResultBlock struct { Type: "text_editor_code_execution_view_result"; Content; FileType; /* 3 more */ }
Type TextEditorCodeExecutionViewResult
FileType TextEditorCodeExecutionViewResultBlockFileType
type TextEditorCodeExecutionViewResultBlockParamResp struct { Type: "text_editor_code_execution_view_result"; Content; FileType; /* 3 more */ }
FileType TextEditorCodeExecutionViewResultBlockParamFileType
type ThinkingBlock struct { Type: "thinking"; Signature; Thinking }
Type Thinking
Signature stringA 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.
type ThinkingBlockParamResp struct { Type: "thinking"; Signature; Thinking }
Signature stringThe 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.
type ThinkingConfigAdaptive struct { Type: "adaptive"; Display }
Display ThinkingConfigAdaptiveDisplay OptionalControls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. The default depends on the model; see Controlling thinking display.
Controls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. The default depends on the model; see Controlling thinking display.
type ThinkingConfigBetweenTools struct { Type: "between_tools" }
type ThinkingConfigDisabled struct { Type: "disabled" }
type ThinkingConfigEnabled struct { Type: "enabled"; BudgetTokens; Display }
BudgetTokens int64Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
Must be ≥1024 and less than max_tokens.
See extended thinking for details.
Display ThinkingConfigEnabledDisplay OptionalControls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. The default depends on the model; see Controlling thinking display.
Controls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. The default depends on the model; see Controlling thinking display.
type ThinkingConfigParamUnionResp interface{…}Configuration for Claude's thinking.
Configuration for Claude's thinking.
With {"type": "adaptive"}, Claude decides when and how much to think. With {"type": "enabled"} (manual extended thinking), you set a budget_tokens of at least 1,024. Thinking tokens count toward your max_tokens limit.
Which type values are accepted, and what happens when you omit thinking, depend on the model. See thinking for each model's behavior.
type ThinkingDelta struct { Type: "thinking_delta"; Thinking }
Type ThinkingDelta
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.
type Tool struct { Type: "custom"; InputSchema; Name; /* 7 more */ }
type ToolBash20250124 struct { Type: "bash_20250124"; Name; AllowedCallers; /* 4 more */ }
type ToolChoiceUnion interface{…}How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
type ToolChoiceAny struct { Type: "any"; DisableParallelToolUse }The model will use any available tools.
The model will use any available tools.
DisableParallelToolUse bool OptionalWhether 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.
type ToolChoiceAuto struct { Type: "auto"; DisableParallelToolUse }The model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
DisableParallelToolUse bool OptionalWhether 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.
type ToolChoiceNone struct { Type: "none" }The model will not be allowed to use tools.
The model will not be allowed to use tools.
type ToolChoiceTool struct { Type: "tool"; Name; DisableParallelToolUse }The model will use the specified tool with tool_choice.name.
The model will use the specified tool with tool_choice.name.
The name of the tool to use.
DisableParallelToolUse bool OptionalWhether 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.
type ToolReferenceBlock struct { Type: "tool_reference"; ToolName }
Type ToolReference
ToolName string
type ToolReferenceBlockParamResp struct { Type: "tool_reference"; ToolName; CacheControl }Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
ToolName string
CacheControl CacheControlEphemeral OptionalCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
TTL CacheControlEphemeralTTL OptionalThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
type ToolResultBlockParamResp struct { Type: "tool_result"; ToolUseID; CacheControl; /* 3 more */ }
type ToolSearchToolBm25_20251119 struct { Type; Name; AllowedCallers; /* 3 more */ }
type ToolSearchToolRegex20251119 struct { Type; Name; AllowedCallers; /* 3 more */ }
type ToolSearchToolResultBlock struct { Type: "tool_search_tool_result"; Content; ToolUseID }
type ToolSearchToolResultBlockParamResp struct { Type: "tool_search_tool_result"; Content; ToolUseID; CacheControl }
type ToolSearchToolResultError struct { Type: "tool_search_tool_result_error"; ErrorCode; ErrorMessage }
Type ToolSearchToolResultError
ErrorCode ToolSearchToolResultErrorCode
type ToolSearchToolResultErrorCode string
type ToolSearchToolResultErrorParamResp struct { Type: "tool_search_tool_result_error"; ErrorCode; ErrorMessage }
ErrorCode ToolSearchToolResultErrorCode
type ToolSearchToolSearchResultBlock struct { Type: "tool_search_tool_search_result"; ToolReferences }
Type ToolSearchToolSearchResult
ToolReferences []ToolReferenceBlock
Type ToolReference
ToolName string
type ToolSearchToolSearchResultBlockParamResp struct { Type: "tool_search_tool_search_result"; ToolReferences }
ToolReferences []ToolReferenceBlockParamResp
ToolName string
CacheControl CacheControlEphemeral OptionalCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
TTL CacheControlEphemeralTTL OptionalThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
type ToolTextEditor20250124 struct { Type: "text_editor_20250124"; Name; AllowedCallers; /* 4 more */ }
type ToolTextEditor20250429 struct { Type: "text_editor_20250429"; Name; AllowedCallers; /* 4 more */ }
type ToolTextEditor20250728 struct { Type: "text_editor_20250728"; Name; AllowedCallers; /* 5 more */ }
type ToolUnion interface{…}
type ToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type ToolUseBlockParamResp struct { Type: "tool_use"; ID; Input; /* 4 more */ }
type ToolUseCallerUnion interface{…}Which party invoked the tool call: the model directly, or a server tool on its behalf.
Which party invoked the tool call: the model directly, or a server tool on its behalf.
type DirectCaller struct { Type: "direct" }Tool invocation directly from the model.
Tool invocation directly from the model.
type ServerToolCaller struct { Type: "code_execution_20250825"; ToolID }Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
ToolID string
type ServerToolCaller20260120 struct { Type: "code_execution_20260120"; ToolID }
ToolID string
type ToolsetToolUseBlockUnion interface{…}
type BrowserToolUseBlockUnion interface{…}
type ComputerToolUseBlockUnion interface{…}
type ToolUseBlock struct { Type: "tool_use"; ID; Caller; /* 3 more */ }
type URLImageSource struct { Type: "url"; URL }
type URLPDFSource struct { Type: "url"; URL }
type Usage struct { CacheCreation; CacheCreationInputTokens; CacheReadInputTokens; /* 6 more */ }
type UserLocation struct { Type: "approximate"; City; Country; /* 2 more */ }
City string OptionalThe city of the user.
The city of the user.
Country string OptionalThe two letter ISO country code of the user.
The two letter ISO country code of the user.
Region string OptionalThe region of the user.
The region of the user.
Timezone string OptionalThe IANA timezone of the user.
The IANA timezone of the user.
type WebFetchBlock struct { Type: "web_fetch_result"; Content; RetrievedAt; URL }
type WebFetchBlockParamResp struct { Type: "web_fetch_result"; Content; URL; RetrievedAt }
Content DocumentBlockParamResp
Fetched content URL
ISO 8601 timestamp when the content was retrieved
type WebFetchTool20250910 struct { Type: "web_fetch_20250910"; Name; AllowedCallers; /* 9 more */ }
type WebFetchTool20260209 struct { Type: "web_fetch_20260209"; Name; AllowedCallers; /* 9 more */ }
type WebFetchTool20260309 struct { Type: "web_fetch_20260309"; Name; AllowedCallers; /* 10 more */ }Web fetch tool with use_cache parameter for bypassing cached content.
Web fetch tool with use_cache parameter for bypassing cached content.
type WebFetchTool20260318 struct { Type: "web_fetch_20260318"; Name; AllowedCallers; /* 11 more */ }
type WebFetchToolResultBlock struct { Type: "web_fetch_tool_result"; Caller; Content; ToolUseID }
type WebFetchToolResultBlockParamResp struct { Type: "web_fetch_tool_result"; Content; ToolUseID; /* 2 more */ }
type WebFetchToolResultErrorBlock struct { Type: "web_fetch_tool_result_error"; ErrorCode }
type WebFetchToolResultErrorBlockParamResp struct { Type: "web_fetch_tool_result_error"; ErrorCode }
type WebFetchToolResultErrorCode string
type WebFetchURLSourceAll struct { Type: "all" }The url_sources variant under which a source contributes in
full: every result of the tool filter's source, or all user input.
The url_sources variant under which a source contributes in
full: every result of the tool filter's source, or all user input.
type WebFetchURLSourceExcept struct { Type: "except"; Tools }The tool filter variant under which every result but the named
tools' contributes.
The tool filter variant under which every result but the named tools' contributes.
Tools []WebFetchURLSourceToolReference
type WebFetchURLSourceNone struct { Type: "none" }The url_sources variant under which a source contributes nothing:
no result of the tool filter's source, or no user input.
The url_sources variant under which a source contributes nothing:
no result of the tool filter's source, or no user input.
type WebFetchURLSourceOnly struct { Type: "only"; Tools }The tool filter variant under which only the named tools' results
contribute.
The tool filter variant under which only the named tools' results contribute.
Tools []WebFetchURLSourceToolReference
type WebFetchURLSourceToolReference struct { Type: "tool_reference"; Name }One entry of a tool filter's tools: it must name a tool declared
in this request's tools[].
One entry of a tool filter's tools: it must name a tool declared
in this request's tools[].
type WebFetchURLSources struct { ClientToolResults; ServerToolResults; UserInput }Which sources contribute to the set of URLs web fetch may fetch.
Which sources contribute to the set of URLs web fetch may fetch.
Each key is a tagged variant: user_input is all or none; the
two tool filters are all, none, only (only the named tools'
results) or except (every result but the named tools'). A named tool
must be declared in this request's tools[].
type WebSearchResultBlock struct { Type: "web_search_result"; EncryptedContent; PageAge; /* 2 more */ }
Type WebSearchResult
type WebSearchResultBlockParamResp struct { Type: "web_search_result"; EncryptedContent; Title; /* 2 more */ }
type WebSearchTool20250305 struct { Type: "web_search_20250305"; Name; AllowedCallers; /* 7 more */ }
type WebSearchTool20260209 struct { Type: "web_search_20260209"; Name; AllowedCallers; /* 7 more */ }
type WebSearchTool20260318 struct { Type: "web_search_20260318"; Name; AllowedCallers; /* 8 more */ }
type WebSearchToolRequestError struct { Type: "web_search_tool_result_error"; ErrorCode }
ErrorCode WebSearchToolResultErrorCode
type WebSearchToolResultBlock struct { Type: "web_search_tool_result"; Caller; Content; ToolUseID }
type WebSearchToolResultBlockContentUnion interface{…}
type WebSearchToolResultBlockParamResp struct { Type: "web_search_tool_result"; Content; ToolUseID; /* 2 more */ }
type WebSearchToolResultBlockParamContentUnionResp interface{…}
type WebSearchToolResultError struct { Type: "web_search_tool_result_error"; ErrorCode }
Type WebSearchToolResultError
ErrorCode WebSearchToolResultErrorCode
type WebSearchToolResultErrorCode string
MessagesBatches
Create a Message Batch
client.Messages.Batches.New(ctx, params) (*MessageBatch, error)Send a batch of Message creation requests.
Retrieve a Message Batch
client.Messages.Batches.Get(ctx, messageBatchID, query) (*MessageBatch, error)This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the results_url field in the response.
List Message Batches
client.Messages.Batches.List(ctx, params) (*Page[MessageBatch], error)List all Message Batches within a Workspace. Most recently created batches are returned first.
Cancel a Message Batch
client.Messages.Batches.Cancel(ctx, messageBatchID, body) (*MessageBatch, error)Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a canceling state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
Delete a Message Batch
client.Messages.Batches.Delete(ctx, messageBatchID, body) (*DeletedMessageBatch, error)Retrieve Message Batch results
client.Messages.Batches.Results(ctx, messageBatchID, query) (*MessageBatchIndividualResponse, error)Streams the results of a Message Batch as a .jsonl file.