Claude Platform Docs

Messages

Create a Message
Message Messages.Create(parameters, cancellationToken = default)
POST/v1/messages

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
MessageTokensCount Messages.CountTokens(parameters, cancellationToken = default)
POST/v1/messages/count_tokens

Count the number of tokens in a Message.

Models
class Base64ImageSource { Type = "base64"; Data; MediaType; }
JsonElement Type = "base64"
required string Data
formatbyte
required MediaType MediaType
One of the following:
ImageJpeg("image/jpeg")
ImagePng("image/png")
ImageGif("image/gif")
ImageWebP("image/webp")
class Base64PdfSource { Type = "base64"; Data; MediaType; }
JsonElement Type = "base64"
required string Data
formatbyte
JsonElement MediaType = "application/pdf"
class BashCodeExecutionOutputBlock { Type = "bash_code_execution_output"; FileID; }
JsonElement Type = "bash_code_execution_output"
required string FileID
class BashCodeExecutionOutputBlockParam { Type = "bash_code_execution_output"; FileID; }
JsonElement Type = "bash_code_execution_output"
required string FileID
class BashCodeExecutionResultBlock { Type = "bash_code_execution_result"; Content; ReturnCode; /* 2 more */ }
JsonElement Type = "bash_code_execution_result"
required IReadOnlyList<BashCodeExecutionOutputBlock> Content
JsonElement Type = "bash_code_execution_output"
required string FileID
required long ReturnCode
required string Stderr
required string Stdout
class BashCodeExecutionResultBlockParam { Type = "bash_code_execution_result"; Content; ReturnCode; /* 2 more */ }
JsonElement Type = "bash_code_execution_result"
required IReadOnlyList<BashCodeExecutionOutputBlockParam> Content
JsonElement Type = "bash_code_execution_output"
required string FileID
required long ReturnCode
required string Stderr
required string Stdout
class BashCodeExecutionToolResultBlock { Type = "bash_code_execution_tool_result"; Content; ToolUseID; }
class BashCodeExecutionToolResultBlockParam { Type = "bash_code_execution_tool_result"; Content; ToolUseID; CacheControl; }
class BashCodeExecutionToolResultError { Type = "bash_code_execution_tool_result_error"; ErrorCode; }
JsonElement Type = "bash_code_execution_tool_result_error"
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
OutputFileTooLarge("output_file_too_large")
enum BashCodeExecutionToolResultErrorCode
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
OutputFileTooLarge("output_file_too_large")
class BashCodeExecutionToolResultErrorParam { Type = "bash_code_execution_tool_result_error"; ErrorCode; }
JsonElement Type = "bash_code_execution_tool_result_error"
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
OutputFileTooLarge("output_file_too_large")
class BrowserClickTarget: union

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

class BrowserCoordinateTarget { Type = "coordinate"; X; Y; }

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
class BrowserRefTarget { 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.

JsonElement Type = "ref"
required string Ref

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

class BrowserCloseTabConfig { DeferLoading; Enabled; }

close_tab's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserCloseTabInput { TabID; }

Close the tab with the given tab_id.

required string TabID

The tab to close.

class BrowserCloseTabToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserCoordinateTarget { Type = "coordinate"; X; Y; }

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
class BrowserDoubleClickConfig { DeferLoading; Enabled; }

double_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserDoubleClickInput { Target; Modifiers; TabID; }

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

class BrowserDoubleClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserFileUploadConfig { DeferLoading; Enabled; }

file_upload's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserFileUploadInput { Target; DocumentIds; Paths; TabID; }

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.

required BrowserRefTarget Target

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.

JsonElement Type = "ref"
required string Ref

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

IReadOnlyList<string>? DocumentIds

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

minItems1
IReadOnlyList<string>? Paths

File paths on the browser executor's filesystem.

minItems1
string? TabID

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

class BrowserFileUploadToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserFindConfig { DeferLoading; Enabled; }

find's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserFindInput { Query; TabID; }

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

required string Query

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

string? TabID

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

class BrowserFindToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserFormInputConfig { DeferLoading; Enabled; }

form_input's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserFormInputInput { Target; Value; TabID; }

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

required BrowserRefTarget Target

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.

JsonElement Type = "ref"
required string Ref

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

required BrowserFormInputValue Value

The value to set.

One of the following:
string
double
bool
string? TabID

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

class BrowserFormInputToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserFormInputValue: union
string
double
bool
class BrowserGetPageTextConfig { DeferLoading; Enabled; }

get_page_text's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserGetPageTextInput { TabID; }

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

string? TabID

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

class BrowserGetPageTextToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserHoldKeyConfig { DeferLoading; Enabled; }

hold_key's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserHoldKeyInput { Duration; Text; TabID; }

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.

required double Duration

Seconds to hold the key down (maximum 30).

minimum0
maximum30
required string Text

The key or chord to hold.

string? TabID

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

class BrowserHoldKeyToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserHoverConfig { DeferLoading; Enabled; }

hover's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserHoverInput { Target; TabID; }

Move the cursor to a coordinate or element without clicking.

required BrowserClickTarget Target

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

One of the following:
class BrowserCoordinateTarget { Type = "coordinate"; X; Y; }

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
class BrowserRefTarget { 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.

JsonElement Type = "ref"
required string Ref

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

string? TabID

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

class BrowserHoverToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserJavascriptExecConfig { DeferLoading; Enabled; }

javascript_exec's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserJavascriptExecInput { Text; TabID; }

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.

required string Text

JavaScript to execute in the page context.

string? TabID

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

class BrowserJavascriptExecToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserKeyConfig { DeferLoading; Enabled; }

key's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserKeyInput { Text; Repeat; TabID; }

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.

required string Text

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

long? Repeat

Number of times to repeat. Default 1.

minimum1
maximum100
string? TabID

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

class BrowserKeyToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserLeftClickConfig { DeferLoading; Enabled; }

left_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserLeftClickDragConfig { DeferLoading; Enabled; }

left_click_drag's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserLeftClickDragInput { From; Target; TabID; }

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

required BrowserCoordinateTarget From

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
required BrowserCoordinateTarget Target

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
string? TabID

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

class BrowserLeftClickDragToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserLeftClickInput { Target; Modifiers; TabID; }

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

class BrowserLeftClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserLeftMouseDownConfig { DeferLoading; Enabled; }

left_mouse_down's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserLeftMouseDownInput { Target; TabID; }

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

required BrowserCoordinateTarget Target

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
string? TabID

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

class BrowserLeftMouseDownToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserLeftMouseUpConfig { DeferLoading; Enabled; }

left_mouse_up's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserLeftMouseUpInput { Target; TabID; }

Release the left mouse button at a viewport coordinate.

required BrowserCoordinateTarget Target

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
string? TabID

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

class BrowserLeftMouseUpToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserListTabsConfig { DeferLoading; Enabled; }

list_tabs's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserListTabsInput:

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

class BrowserListTabsToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserMiddleClickConfig { DeferLoading; Enabled; }

middle_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserMiddleClickInput { Target; Modifiers; TabID; }

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

class BrowserMiddleClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserMouseMoveConfig { DeferLoading; Enabled; }

mouse_move's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserMouseMoveInput { Target; TabID; }

Move the pointer to a viewport coordinate without clicking.

required BrowserCoordinateTarget Target

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
string? TabID

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

class BrowserMouseMoveToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserNavigateConfig { DeferLoading; Enabled; }

navigate's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserNavigateInput { Url; TabID; }

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

required string Url

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

string? TabID

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

class BrowserNavigateToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserNewTabConfig { DeferLoading; Enabled; }

new_tab's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserNewTabInput:

Open a new empty tab and return its tab_id.

class BrowserNewTabToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserReadConsoleConfig { DeferLoading; Enabled; }

read_console's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserReadConsoleInput { TabID; }

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.

string? TabID

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

class BrowserReadConsoleToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserReadNetworkConfig { DeferLoading; Enabled; }

read_network's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserReadNetworkInput { TabID; }

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.

string? TabID

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

class BrowserReadNetworkToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserReadPageConfig { DeferLoading; Enabled; }

read_page's config overrides.

bool? DeferLoading

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

bool? Enabled

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

enum BrowserReadPageFilter
All("all")
Interactive("interactive")
class BrowserReadPageInput { 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.

long? Depth

Maximum tree depth. Default 15.

minimum1

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

One of the following:
All("all")
Interactive("interactive")
string? Ref

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

string? TabID

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

class BrowserReadPageToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserRefTarget { 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.

JsonElement Type = "ref"
required string Ref

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

class BrowserRightClickConfig { DeferLoading; Enabled; }

right_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserRightClickInput { Target; Modifiers; TabID; }

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

class BrowserRightClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserScreenshotConfig { DeferLoading; Enabled; }

screenshot's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserScreenshotInput { TabID; }

Capture the current browser viewport.

string? TabID

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

class BrowserScreenshotToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserScrollConfig { DeferLoading; Enabled; }

scroll's config overrides.

bool? DeferLoading

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

bool? Enabled

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

enum BrowserScrollDirection
Up("up")
Down("down")
Left("left")
Right("right")
class BrowserScrollInput { ScrollDirection; Target; ScrollAmount; TabID; }

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

required BrowserScrollDirection ScrollDirection
One of the following:
Up("up")
Down("down")
Left("left")
Right("right")
required BrowserCoordinateTarget Target

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

JsonElement Type = "coordinate"
required long X

Pixels from the left edge of the viewport.

minimum0
required long Y

Pixels from the top edge of the viewport.

minimum0
long? ScrollAmount

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

minimum1
maximum10
string? TabID

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

class BrowserScrollToConfig { DeferLoading; Enabled; }

scroll_to's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserScrollToInput { Target; TabID; }

Scroll an element into view.

required BrowserRefTarget Target

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.

JsonElement Type = "ref"
required string Ref

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

string? TabID

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

class BrowserScrollToToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserScrollToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserStateBlockParam { 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.

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.

class BrowserStateChange: union
class BrowserStateChangeDownloadCompleted { 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).

JsonElement Type = "download_completed"
required string DownloadID

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

minLength1
maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
required string Url

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

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
string? Path

Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
long? SizeBytes

The completed download's size.

minimum0
class BrowserStateChangeDownloadFailed { Type = "download_failed"; DownloadID; Url; Error; }

A file download that failed — or was cancelled — during this call.

JsonElement Type = "download_failed"
required string DownloadID

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

minLength1
maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
required string Url

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

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
string? Error

The failure or cancellation detail, when known.

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
class BrowserStateChangeDownloadStarted { Type = "download_started"; DownloadID; Url; }

A file download that started during this call.

JsonElement Type = "download_started"
required string DownloadID

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

minLength1
maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
required string Url

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

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
class BrowserStateChangeTabOpened { 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.

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.

JsonElement Type = "tab_opened"
required string TabID

The tab_id of the opened tab, present in tabs.

minLength1
maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
class BrowserStateTabEntry { TabID; Title; Url; Active; }

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.

required string TabID

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

minLength1
maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
required string Title

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

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
required string Url

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

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
bool Active

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

class BrowserSwitchTabConfig { DeferLoading; Enabled; }

switch_tab's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserSwitchTabInput { TabID; }

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

required string TabID

The tab to switch to.

class BrowserSwitchTabToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserToolUseBlock: union
class BrowserToolset20260801 { 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.

JsonElement Type = "browser_toolset_20260801"
CacheControlEphemeral? CacheControl

Create a cache control breakpoint at this content block.

JsonElement Type = "ephemeral"
Ttl Ttl

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

This may be one the following values:

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

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

One of the following:
Ttl5m("5m")
Ttl1h("1h")

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

class BrowserToolsetConfigs { Type; CloseTab; DoubleClick; /* 28 more */ }

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.

class BrowserTripleClickConfig { DeferLoading; Enabled; }

triple_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserTripleClickInput { Target; Modifiers; TabID; }

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

class BrowserTripleClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserTypeConfig { DeferLoading; Enabled; }

type's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserTypeInput { Text; TabID; }

Type a literal string at the current focus.

required string Text

The text to type.

string? TabID

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

class BrowserTypeToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserWaitConfig { DeferLoading; Enabled; }

wait's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserWaitInput { Duration; TabID; }

Pause for the given duration.

required double Duration

Seconds to wait (maximum 30).

minimum0
maximum30
string? TabID

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

class BrowserWaitToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class BrowserZoomConfig { DeferLoading; Enabled; }

zoom's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class BrowserZoomInput { Region; TabID; }

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.

required IReadOnlyList<long> Region

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

minItems4
maxItems4
string? TabID

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

class BrowserZoomToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class CacheControlEphemeral { Type = "ephemeral"; Ttl; }
JsonElement Type = "ephemeral"
Ttl Ttl

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

This may be one the following values:

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

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

One of the following:
Ttl5m("5m")
Ttl1h("1h")
class CacheCreation { Ephemeral1hInputTokens; Ephemeral5mInputTokens; }
required long Ephemeral1hInputTokens

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

minimum0
required long Ephemeral5mInputTokens

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

minimum0
class CacheMissMessagesChanged { Type = "messages_changed"; CacheMissedInputTokens; }
JsonElement Type = "messages_changed"
required long CacheMissedInputTokens

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

class CacheMissModelChanged { Type = "model_changed"; CacheMissedInputTokens; }
JsonElement Type = "model_changed"
required long CacheMissedInputTokens

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

class CacheMissPreviousMessageNotFound { Type = "previous_message_not_found"; }
JsonElement Type = "previous_message_not_found"
class CacheMissReason: union
class CacheMissSystemChanged { Type = "system_changed"; CacheMissedInputTokens; }
JsonElement Type = "system_changed"
required long CacheMissedInputTokens

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

class CacheMissToolsChanged { Type = "tools_changed"; CacheMissedInputTokens; }
JsonElement Type = "tools_changed"
required long CacheMissedInputTokens

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

class CacheMissUnavailable { Type = "unavailable"; }
JsonElement Type = "unavailable"
class CitationCharLocation { Type = "char_location"; CitedText; DocumentIndex; /* 4 more */ }
JsonElement Type = "char_location"
required string CitedText
required long DocumentIndex
minimum0
required string? DocumentTitle
required long EndCharIndex
required string? FileID
required long StartCharIndex
minimum0
class CitationCharLocationParam { Type = "char_location"; CitedText; DocumentIndex; /* 3 more */ }
JsonElement Type = "char_location"
required string CitedText
required long DocumentIndex
minimum0
required string? DocumentTitle
minLength1
maxLength500
required long EndCharIndex
required long StartCharIndex
minimum0
class CitationContentBlockLocation { Type = "content_block_location"; CitedText; DocumentIndex; /* 4 more */ }
JsonElement Type = "content_block_location"
required string CitedText

The full text of the cited block range, concatenated.

Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.

required long DocumentIndex
minimum0
required string? DocumentTitle
required long EndBlockIndex

Exclusive 0-based end index of the cited block range in the source's content array.

Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.

required string? FileID
required long StartBlockIndex

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

minimum0
class CitationContentBlockLocationParam { Type = "content_block_location"; CitedText; DocumentIndex; /* 3 more */ }
JsonElement Type = "content_block_location"
required string CitedText

The full text of the cited block range, concatenated.

Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.

required long DocumentIndex
minimum0
required string? DocumentTitle
minLength1
maxLength500
required long EndBlockIndex

Exclusive 0-based end index of the cited block range in the source's content array.

Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.

required long StartBlockIndex

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

minimum0
class CitationPageLocation { Type = "page_location"; CitedText; DocumentIndex; /* 4 more */ }
JsonElement Type = "page_location"
required string CitedText
required long DocumentIndex
minimum0
required string? DocumentTitle
required long EndPageNumber
required string? FileID
required long StartPageNumber
minimum1
class CitationPageLocationParam { Type = "page_location"; CitedText; DocumentIndex; /* 3 more */ }
JsonElement Type = "page_location"
required string CitedText
required long DocumentIndex
minimum0
required string? DocumentTitle
minLength1
maxLength500
required long EndPageNumber
required long StartPageNumber
minimum1
class CitationSearchResultLocationParam { Type = "search_result_location"; CitedText; EndBlockIndex; /* 4 more */ }
JsonElement Type = "search_result_location"
required string CitedText

The full text of the cited block range, concatenated.

Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.

required long EndBlockIndex

Exclusive 0-based end index of the cited block range in the source's content array.

Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.

required long SearchResultIndex

0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.

Counted separately from document_index; server-side web search results are not included in this count.

minimum0
required string Source
required long StartBlockIndex

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

minimum0
required string? Title
class CitationWebSearchResultLocationParam { Type = "web_search_result_location"; CitedText; EncryptedIndex; /* 2 more */ }
JsonElement Type = "web_search_result_location"
required string CitedText
required string EncryptedIndex
required string? Title
minLength1
maxLength512
required string Url
minLength1
class CitationsConfig { Enabled; }
required bool Enabled
class CitationsConfigParam { Enabled; }
bool Enabled
class CitationsDelta { Type = "citations_delta"; Citation; }
class CitationsSearchResultLocation { Type = "search_result_location"; CitedText; EndBlockIndex; /* 4 more */ }
JsonElement Type = "search_result_location"
required string CitedText

The full text of the cited block range, concatenated.

Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.

required long EndBlockIndex

Exclusive 0-based end index of the cited block range in the source's content array.

Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.

required long SearchResultIndex

0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.

Counted separately from document_index; server-side web search results are not included in this count.

minimum0
required string Source
required long StartBlockIndex

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

minimum0
required string? Title
class CitationsWebSearchResultLocation { Type = "web_search_result_location"; CitedText; EncryptedIndex; /* 2 more */ }
JsonElement Type = "web_search_result_location"
required string CitedText
required string EncryptedIndex
required string? Title
maxLength512
required string Url
class CodeExecutionOutputBlock { Type = "code_execution_output"; FileID; }
JsonElement Type = "code_execution_output"
required string FileID
class CodeExecutionOutputBlockParam { Type = "code_execution_output"; FileID; }
JsonElement Type = "code_execution_output"
required string FileID
class CodeExecutionResultBlock { Type = "code_execution_result"; Content; ReturnCode; /* 2 more */ }
JsonElement Type = "code_execution_result"
required IReadOnlyList<CodeExecutionOutputBlock> Content
JsonElement Type = "code_execution_output"
required string FileID
required long ReturnCode
required string Stderr
required string Stdout
class CodeExecutionResultBlockParam { Type = "code_execution_result"; Content; ReturnCode; /* 2 more */ }
JsonElement Type = "code_execution_result"
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
JsonElement Type = "code_execution_output"
required string FileID
required long ReturnCode
required string Stderr
required string Stdout
class CodeExecutionTool20250522 { Type = "code_execution_20250522"; Name; AllowedCallers; /* 3 more */ }
class CodeExecutionTool20250825 { Type = "code_execution_20250825"; Name; AllowedCallers; /* 3 more */ }
class CodeExecutionTool20260120 { Type = "code_execution_20260120"; Name; AllowedCallers; /* 3 more */ }

Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).

class CodeExecutionTool20260521 { Type = "code_execution_20260521"; Name; AllowedCallers; /* 3 more */ }

Code execution tool with REPL state persistence.

class CodeExecutionToolResultBlock { Type = "code_execution_tool_result"; Content; ToolUseID; }
JsonElement Type = "code_execution_tool_result"
One of the following:
required string ToolUseID
pattern^srvtoolu_[a-zA-Z0-9_]+$
class CodeExecutionToolResultBlockContent: union
class CodeExecutionToolResultBlockParam { Type = "code_execution_tool_result"; Content; ToolUseID; CacheControl; }
JsonElement Type = "code_execution_tool_result"
One of the following:
required string ToolUseID
pattern^srvtoolu_[a-zA-Z0-9_]+$
CacheControlEphemeral? CacheControl

Create a cache control breakpoint at this content block.

JsonElement Type = "ephemeral"
Ttl Ttl

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

This may be one the following values:

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

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

One of the following:
Ttl5m("5m")
Ttl1h("1h")
class CodeExecutionToolResultBlockParamContent: union
class CodeExecutionToolResultError { Type = "code_execution_tool_result_error"; ErrorCode; }
JsonElement Type = "code_execution_tool_result_error"
required CodeExecutionToolResultErrorCode ErrorCode
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
enum CodeExecutionToolResultErrorCode
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
class CodeExecutionToolResultErrorParam { Type = "code_execution_tool_result_error"; ErrorCode; }
JsonElement Type = "code_execution_tool_result_error"
required CodeExecutionToolResultErrorCode ErrorCode
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
class ComputerCursorPositionConfig { DeferLoading; Enabled; }

cursor_position's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerCursorPositionInput:

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

class ComputerCursorPositionToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerDoubleClickConfig { DeferLoading; Enabled; }

double_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerDoubleClickInput { Coordinate; Text; }

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

IReadOnlyList<long>? Coordinate

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

minItems2
maxItems2
string? Text

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

class ComputerDoubleClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerHoldKeyConfig { DeferLoading; Enabled; }

hold_key's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerHoldKeyInput { Duration; Text; }

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

required long Duration

Duration to hold the key, in seconds.

maximum300
required string Text

The key or key-combination to hold.

class ComputerHoldKeyToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerKeyConfig { DeferLoading; Enabled; }

key's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerKeyInput { Text; Repeat; }

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.

required string Text

The key or key-combination to press.

long? Repeat

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

minimum1
maximum100
class ComputerKeyToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerLeftClickConfig { DeferLoading; Enabled; }

left_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerLeftClickDragConfig { DeferLoading; Enabled; }

left_click_drag's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerLeftClickDragInput { Coordinate; StartCoordinate; Text; }

Click and drag the cursor from start_coordinate to coordinate.

required IReadOnlyList<long> Coordinate

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

minItems2
maxItems2
required IReadOnlyList<long> StartCoordinate

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

minItems2
maxItems2
string? Text

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

class ComputerLeftClickDragToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerLeftClickInput { Coordinate; Text; }

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

IReadOnlyList<long>? Coordinate

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

minItems2
maxItems2
string? Text

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

class ComputerLeftClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerLeftMouseDownConfig { DeferLoading; Enabled; }

left_mouse_down's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerLeftMouseDownInput:

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

class ComputerLeftMouseDownToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerLeftMouseUpConfig { DeferLoading; Enabled; }

left_mouse_up's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerLeftMouseUpInput:

Release the left mouse button.

class ComputerLeftMouseUpToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerMiddleClickConfig { DeferLoading; Enabled; }

middle_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerMiddleClickInput { Coordinate; Text; }

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

IReadOnlyList<long>? Coordinate

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

minItems2
maxItems2
string? Text

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

class ComputerMiddleClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerMouseMoveConfig { DeferLoading; Enabled; }

mouse_move's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerMouseMoveInput { Coordinate; }

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

required IReadOnlyList<long> Coordinate

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

minItems2
maxItems2
class ComputerMouseMoveToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerRightClickConfig { DeferLoading; Enabled; }

right_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerRightClickInput { Coordinate; Text; }

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

IReadOnlyList<long>? Coordinate

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

minItems2
maxItems2
string? Text

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

class ComputerRightClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerScreenshotConfig { DeferLoading; Enabled; }

screenshot's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerScreenshotInput:

Take a screenshot of the screen.

class ComputerScreenshotToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerScrollConfig { DeferLoading; Enabled; }

scroll's config overrides.

bool? DeferLoading

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

bool? Enabled

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

enum ComputerScrollDirection
Up("up")
Down("down")
Left("left")
Right("right")
class ComputerScrollInput { 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.

required long ScrollAmount

Number of 'clicks' of the scroll wheel.

required ComputerScrollDirection ScrollDirection
One of the following:
Up("up")
Down("down")
Left("left")
Right("right")
IReadOnlyList<long>? Coordinate

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

minItems2
maxItems2
string? Text

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

class ComputerScrollToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerToolUseBlock: union
class ComputerToolset20260801 { 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.

JsonElement Type = "computer_toolset_20260801"
CacheControlEphemeral? CacheControl

Create a cache control breakpoint at this content block.

JsonElement Type = "ephemeral"
Ttl Ttl

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

This may be one the following values:

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

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

One of the following:
Ttl5m("5m")
Ttl1h("1h")

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

class ComputerToolsetConfigs { Type; CursorPosition; DoubleClick; /* 14 more */ }

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.

class ComputerTripleClickConfig { DeferLoading; Enabled; }

triple_click's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerTripleClickInput { Coordinate; Text; }

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

IReadOnlyList<long>? Coordinate

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

minItems2
maxItems2
string? Text

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

class ComputerTripleClickToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerTypeConfig { DeferLoading; Enabled; }

type's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerTypeInput { Text; }

Type a string of text on the keyboard.

required string Text

The text to type.

class ComputerTypeToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerWaitConfig { DeferLoading; Enabled; }

wait's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerWaitInput { Duration; }

Wait for a specified duration.

required long Duration

Duration to wait, in seconds.

maximum300
class ComputerWaitToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ComputerZoomConfig { DeferLoading; Enabled; }

zoom's config overrides.

bool? DeferLoading

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

bool? Enabled

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

class ComputerZoomInput { Region; }

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.

required IReadOnlyList<long> Region

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

minItems4
maxItems4
class ComputerZoomToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class Container { ID; ExpiresAt; Skills; }

Information about the container used in the request (for the code execution tool)

required string ID

Identifier for the container used in this request

required DateTimeOffset ExpiresAt

The time at which the container will expire.

formatdate-time
required IReadOnlyList<ContainerSkill>? Skills

Skills loaded in the container

required ContainerSkillType Type

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

One of the following:
Anthropic("anthropic")
Custom("custom")
required string SkillID

Skill ID

minLength1
maxLength64
required string Version

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

minLength1
maxLength64
class ContainerParams { ID; Skills; }

Container parameters with skills to be loaded.

string? ID

Container id

IReadOnlyList<SkillParams>? Skills

List of skills to load in the container

maxItems20
required SkillParamsType Type

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

One of the following:
Anthropic("anthropic")
Custom("custom")
required string SkillID

Skill ID

minLength1
maxLength64
string Version

Skill version or 'latest' for most recent version

minLength1
maxLength64
class ContainerSkill { Type; SkillID; Version; }

A skill that was loaded in a container (response model).

required ContainerSkillType Type

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

One of the following:
Anthropic("anthropic")
Custom("custom")
required string SkillID

Skill ID

minLength1
maxLength64
required string Version

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

minLength1
maxLength64
class ContainerUploadBlock { Type = "container_upload"; FileID; }

Response model for a file uploaded to the container.

JsonElement Type = "container_upload"
required string FileID
class ContainerUploadBlockParam { 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.

JsonElement Type = "container_upload"
required string FileID
CacheControlEphemeral? CacheControl

Create a cache control breakpoint at this content block.

JsonElement Type = "ephemeral"
Ttl Ttl

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

This may be one the following values:

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

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

One of the following:
Ttl5m("5m")
Ttl1h("1h")
class ContentBlock: union
class ContentBlockParam: union
class ContentBlockSource { Type = "content"; Content; }
JsonElement Type = "content"
required Content Content
One of the following:
string
IReadOnlyList<ContentBlockSourceContent>
One of the following:
class TextBlockParam { Type = "text"; Text; CacheControl; Citations; }
class ImageBlockParam { Type = "image"; Source; CacheControl; Transformations; }
class ContentBlockSourceContent: union
class TextBlockParam { Type = "text"; Text; CacheControl; Citations; }
class ImageBlockParam { Type = "image"; Source; CacheControl; Transformations; }
class Diagnostics { CacheMissReason; }

Request-level diagnostics: why the prompt cache could not fully reuse the prefix of the request named by diagnostics.previous_message_id.

required CacheMissReason? CacheMissReason

Explains why the prompt cache could not fully reuse the prefix from the request identified by diagnostics.previous_message_id. null means diagnosis is still pending — the response was serialized before the background comparison completed.

One of the following:
class DiagnosticsParam { PreviousMessageID; }

Request-level diagnostics. Currently carries the previous response id for prompt-cache divergence reporting.

string? PreviousMessageID

The id (msg_...) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns diagnostics.cache_miss_reason when the prompt-cache prefix could not be reused. Pass null on the first turn to opt in without a prior message to compare.

maxLength256
class DirectCaller { Type = "direct"; }

Tool invocation directly from the model.

JsonElement Type = "direct"
class DocumentBlock { Type = "document"; Citations; Source; Title; }
class DocumentBlockParam { Type = "document"; Source; CacheControl; /* 3 more */ }
class EncryptedCodeExecutionResultBlock { Type = "encrypted_code_execution_result"; Content; EncryptedStdout; /* 2 more */ }

Code execution result with encrypted stdout for PFC + web_search results.

JsonElement Type = "encrypted_code_execution_result"
required IReadOnlyList<CodeExecutionOutputBlock> Content
JsonElement Type = "code_execution_output"
required string FileID
required string EncryptedStdout
required long ReturnCode
required string Stderr
class EncryptedCodeExecutionResultBlockParam { Type = "encrypted_code_execution_result"; Content; EncryptedStdout; /* 2 more */ }

Code execution result with encrypted stdout for PFC + web_search results.

JsonElement Type = "encrypted_code_execution_result"
required IReadOnlyList<CodeExecutionOutputBlockParam> Content
JsonElement Type = "code_execution_output"
required string FileID
required string EncryptedStdout
required long ReturnCode
required string Stderr
class FileDocumentSource { Type = "file"; FileID; }
JsonElement Type = "file"
required string FileID
class FileImageSource { Type = "file"; FileID; }
JsonElement Type = "file"
required string FileID
class ImageBlockParam { Type = "image"; Source; CacheControl; Transformations; }
class ImageTransformationsParam { 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.

OversizedImage OversizedImage

What the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.

One of the following:
Downsize("downsize")
Error("error")
class InputJsonDelta { Type = "input_json_delta"; PartialJson; }
JsonElement Type = "input_json_delta"
required string PartialJson
class JsonOutputFormat { Type = "json_schema"; Schema; }
JsonElement Type = "json_schema"
required IReadOnlyDictionary<string, JsonElement> Schema

The JSON schema of the format

class MemoryTool20250818 { Type = "memory_20250818"; Name; AllowedCallers; /* 4 more */ }
class Message { Type = "message"; ID; Container; /* 8 more */ }
class MessageCountTokensTool: union
class MessageCreateParamsContainer: union

Container identifier for reuse across requests.

class ContainerParams { ID; Skills; }

Container parameters with skills to be loaded.

string? ID

Container id

IReadOnlyList<SkillParams>? Skills

List of skills to load in the container

maxItems20
required SkillParamsType Type

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

One of the following:
Anthropic("anthropic")
Custom("custom")
required string SkillID

Skill ID

minLength1
maxLength64
string Version

Skill version or 'latest' for most recent version

minLength1
maxLength64
string
class MessageDeltaUsage { CacheCreationInputTokens; CacheReadInputTokens; InputTokens; /* 3 more */ }
required long? CacheCreationInputTokens

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

minimum0
required long? CacheReadInputTokens

The cumulative number of input tokens read from the cache.

minimum0
required long? InputTokens

The cumulative number of input tokens which were used.

minimum0
required long OutputTokens

The cumulative number of output tokens which were used.

required OutputTokensDetails? OutputTokensDetails

Breakdown of output tokens by category.

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

required long ThinkingTokens

Number of output tokens the model generated as internal reasoning, including the thinking-block delimiter tokens.

Reflects the raw reasoning the model produced, not the (possibly shorter) summarized thinking text returned in the response body. 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.

minimum0
required ServerToolUsage? ServerToolUse

The number of server tool requests.

required long WebFetchRequests

The number of web fetch tool requests.

minimum0
required long WebSearchRequests

The number of web search tool requests.

minimum0
class MessageParam { Content; Role; }
class MessageTokensCount { InputTokens; }
required long InputTokens

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

class Metadata { UserID; }
string? UserID

An external identifier for the user who is associated with the request.

This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.

maxLength512
class OutputConfig { Effort; Format; }
Effort? Effort

How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.

Valid values are low, medium, high, xhigh, or max.

One of the following:
Low("low")
Medium("medium")
High("high")
Xhigh("xhigh")
Max("max")
JsonOutputFormat? Format

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

JsonElement Type = "json_schema"
required IReadOnlyDictionary<string, JsonElement> Schema

The JSON schema of the format

class OutputTokensDetails { ThinkingTokens; }
required long ThinkingTokens

Number of output tokens the model generated as internal reasoning, including the thinking-block delimiter tokens.

Reflects the raw reasoning the model produced, not the (possibly shorter) summarized thinking text returned in the response body. 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.

minimum0
class PlainTextSource { Type = "text"; Data; MediaType; }
JsonElement Type = "text"
required string Data
JsonElement MediaType = "text/plain"
class RawContentBlockDelta: union
class RawContentBlockDeltaEvent { Type = "content_block_delta"; Delta; Index; }
JsonElement Type = "content_block_delta"
required RawContentBlockDelta Delta
One of the following:
required long Index
class RawContentBlockStartEvent { Type = "content_block_start"; ContentBlock; Index; }
class RawContentBlockStopEvent { Type = "content_block_stop"; Index; }
JsonElement Type = "content_block_stop"
required long Index
class RawMessageDeltaEvent { Type = "message_delta"; Delta; Usage; }
class RawMessageStartEvent { Type = "message_start"; Message; }
JsonElement Type = "message_start"
required Message Message
class RawMessageStopEvent { Type = "message_stop"; }
JsonElement Type = "message_stop"
class RawMessageStreamEvent: union
class RedactedThinkingBlock { Type = "redacted_thinking"; Data; }
JsonElement Type = "redacted_thinking"
required string Data

The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.

Pass redacted_thinking blocks back to the API unchanged when continuing a multi-turn conversation.

See extended thinking for details.

class RedactedThinkingBlockParam { Type = "redacted_thinking"; Data; }
JsonElement Type = "redacted_thinking"
required string Data

The data value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.

class RefusalStopDetails { Type = "refusal"; Category; Explanation; }

Structured information about a refusal.

JsonElement Type = "refusal"
required Category? Category

The policy category that triggered the refusal.

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

One of the following:
Cyber("cyber")

The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.

Bio("bio")

The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.

FrontierLlm("frontier_llm")

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.

ReasoningExtraction("reasoning_extraction")

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.

GeneralHarms("general_harms")

The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.

required string? Explanation

Human-readable explanation of the refusal.

This text is not guaranteed to be stable. null when no explanation is available for the category.

class SearchResultBlockParam { Type = "search_result"; Content; Source; /* 3 more */ }
class ServerToolCaller { Type = "code_execution_20250825"; ToolID; }

Tool invocation generated by a server-side tool.

JsonElement Type = "code_execution_20250825"
required string ToolID
pattern^srvtoolu_[a-zA-Z0-9_]+$
class ServerToolCaller20260120 { Type = "code_execution_20260120"; ToolID; }
JsonElement Type = "code_execution_20260120"
required string ToolID
pattern^srvtoolu_[a-zA-Z0-9_]+$
class ServerToolUsage { WebFetchRequests; WebSearchRequests; }
required long WebFetchRequests

The number of web fetch tool requests.

minimum0
required long WebSearchRequests

The number of web search tool requests.

minimum0
class ServerToolUseBlock { Type = "server_tool_use"; ID; Caller; /* 2 more */ }
class ServerToolUseBlockParam { Type = "server_tool_use"; ID; Input; /* 3 more */ }
class SignatureDelta { Type = "signature_delta"; Signature; }
JsonElement Type = "signature_delta"
required string Signature

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

class SkillParams { Type; SkillID; Version; }

Specification for a skill to be loaded in a container (request model).

required SkillParamsType Type

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

One of the following:
Anthropic("anthropic")
Custom("custom")
required string SkillID

Skill ID

minLength1
maxLength64
string Version

Skill version or 'latest' for most recent version

minLength1
maxLength64
enum StopReason
EndTurn("end_turn")
MaxTokens("max_tokens")
StopSequence("stop_sequence")
ToolUse("tool_use")
PauseTurn("pause_turn")
Refusal("refusal")
ModelContextWindowExceeded("model_context_window_exceeded")
class TextBlock { Type = "text"; Citations; Text; }
class TextBlockParam { Type = "text"; Text; CacheControl; Citations; }
class TextCitation: union
class TextCitationParam: union
class TextDelta { Type = "text_delta"; Text; }
JsonElement Type = "text_delta"
required string Text
class TextEditorCodeExecutionCreateResultBlock { Type = "text_editor_code_execution_create_result"; IsFileUpdate; }
JsonElement Type = "text_editor_code_execution_create_result"
required bool IsFileUpdate
class TextEditorCodeExecutionCreateResultBlockParam { Type = "text_editor_code_execution_create_result"; IsFileUpdate; }
JsonElement Type = "text_editor_code_execution_create_result"
required bool IsFileUpdate
class TextEditorCodeExecutionStrReplaceResultBlock { Type = "text_editor_code_execution_str_replace_result"; Lines; NewLines; /* 3 more */ }
JsonElement Type = "text_editor_code_execution_str_replace_result"
required IReadOnlyList<string>? Lines
required long? NewLines
required long? NewStart
required long? OldLines
required long? OldStart
class TextEditorCodeExecutionStrReplaceResultBlockParam { Type = "text_editor_code_execution_str_replace_result"; Lines; NewLines; /* 3 more */ }
JsonElement Type = "text_editor_code_execution_str_replace_result"
IReadOnlyList<string>? Lines
long? NewLines
long? NewStart
long? OldLines
long? OldStart
class TextEditorCodeExecutionToolResultBlock { Type = "text_editor_code_execution_tool_result"; Content; ToolUseID; }
class TextEditorCodeExecutionToolResultBlockParam { Type = "text_editor_code_execution_tool_result"; Content; ToolUseID; CacheControl; }
class TextEditorCodeExecutionToolResultError { Type = "text_editor_code_execution_tool_result_error"; ErrorCode; ErrorMessage; }
JsonElement Type = "text_editor_code_execution_tool_result_error"
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
FileNotFound("file_not_found")
required string? ErrorMessage
enum TextEditorCodeExecutionToolResultErrorCode
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
FileNotFound("file_not_found")
class TextEditorCodeExecutionToolResultErrorParam { Type = "text_editor_code_execution_tool_result_error"; ErrorCode; ErrorMessage; }
JsonElement Type = "text_editor_code_execution_tool_result_error"
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
FileNotFound("file_not_found")
string? ErrorMessage
class TextEditorCodeExecutionViewResultBlock { Type = "text_editor_code_execution_view_result"; Content; FileType; /* 3 more */ }
JsonElement Type = "text_editor_code_execution_view_result"
required string Content
required FileType FileType
One of the following:
Text("text")
Image("image")
Pdf("pdf")
required long? NumLines
required long? StartLine
required long? TotalLines
class TextEditorCodeExecutionViewResultBlockParam { Type = "text_editor_code_execution_view_result"; Content; FileType; /* 3 more */ }
JsonElement Type = "text_editor_code_execution_view_result"
required string Content
required FileType FileType
One of the following:
Text("text")
Image("image")
Pdf("pdf")
long? NumLines
long? StartLine
long? TotalLines
class ThinkingBlock { Type = "thinking"; Signature; Thinking; }
JsonElement Type = "thinking"
required string Signature

A value used to verify that this thinking block was generated by Claude when it is passed back to the API.

This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.

See extended thinking for details.

required string Thinking

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

class ThinkingBlockParam { Type = "thinking"; Signature; Thinking; }
JsonElement Type = "thinking"
required string Signature

The signature value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.

Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 invalid_request_error.

required string Thinking

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

class ThinkingConfigAdaptive { Type = "adaptive"; Display; }
JsonElement Type = "adaptive"
Display? Display

Controls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. The default depends on the model; see Controlling thinking display.

One of the following:
Summarized("summarized")
Omitted("omitted")
class ThinkingConfigBetweenTools { Type = "between_tools"; }
JsonElement Type = "between_tools"
class ThinkingConfigDisabled { Type = "disabled"; }
JsonElement Type = "disabled"
class ThinkingConfigEnabled { Type = "enabled"; BudgetTokens; Display; }
JsonElement Type = "enabled"
required long BudgetTokens

Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.

Must be ≥1024 and less than max_tokens.

See extended thinking for details.

minimum1024
Display? Display

Controls how thinking content appears in the response. When set to summarized, thinking is returned normally. When set to omitted, thinking content is redacted but a signature is returned for multi-turn continuity. The default depends on the model; see Controlling thinking display.

One of the following:
Summarized("summarized")
Omitted("omitted")
class ThinkingConfigParam: union

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.

class ThinkingDelta { Type = "thinking_delta"; Thinking; }
JsonElement Type = "thinking_delta"
required string Thinking

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

class Tool { Type; InputSchema; Name; /* 7 more */ }
class ToolBash20250124 { Type = "bash_20250124"; Name; AllowedCallers; /* 4 more */ }
class ToolChoice: union

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.

class ToolChoiceAny { Type = "any"; DisableParallelToolUse; }

The model will use any available tools.

JsonElement Type = "any"
bool DisableParallelToolUse

Whether to disable parallel tool use.

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

class ToolChoiceAuto { Type = "auto"; DisableParallelToolUse; }

The model will automatically decide whether to use tools.

JsonElement Type = "auto"
bool DisableParallelToolUse

Whether to disable parallel tool use.

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

class ToolChoiceNone { Type = "none"; }

The model will not be allowed to use tools.

JsonElement Type = "none"
class ToolChoiceTool { Type = "tool"; Name; DisableParallelToolUse; }

The model will use the specified tool with tool_choice.name.

JsonElement Type = "tool"
required string Name

The name of the tool to use.

bool DisableParallelToolUse

Whether to disable parallel tool use.

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

class ToolReferenceBlock { Type = "tool_reference"; ToolName; }
JsonElement Type = "tool_reference"
required string ToolName
minLength1
maxLength256
pattern^[a-zA-Z0-9_-]{1,256}$
class ToolReferenceBlockParam { Type = "tool_reference"; ToolName; CacheControl; }

Tool reference block that can be included in tool_result content.

JsonElement Type = "tool_reference"
required string ToolName
minLength1
maxLength256
pattern^[a-zA-Z0-9_-]{1,256}$
CacheControlEphemeral? CacheControl

Create a cache control breakpoint at this content block.

JsonElement Type = "ephemeral"
Ttl Ttl

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

This may be one the following values:

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

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

One of the following:
Ttl5m("5m")
Ttl1h("1h")
class ToolResultBlockParam { Type = "tool_result"; ToolUseID; CacheControl; /* 3 more */ }
class ToolSearchToolBm25_20251119 { Type; Name; AllowedCallers; /* 3 more */ }
class ToolSearchToolRegex20251119 { Type; Name; AllowedCallers; /* 3 more */ }
class ToolSearchToolResultBlock { Type = "tool_search_tool_result"; Content; ToolUseID; }
class ToolSearchToolResultBlockParam { Type = "tool_search_tool_result"; Content; ToolUseID; CacheControl; }
class ToolSearchToolResultError { Type = "tool_search_tool_result_error"; ErrorCode; ErrorMessage; }
JsonElement Type = "tool_search_tool_result_error"
required ToolSearchToolResultErrorCode ErrorCode
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
required string? ErrorMessage
enum ToolSearchToolResultErrorCode
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
class ToolSearchToolResultErrorParam { Type = "tool_search_tool_result_error"; ErrorCode; ErrorMessage; }
JsonElement Type = "tool_search_tool_result_error"
required ToolSearchToolResultErrorCode ErrorCode
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
TooManyRequests("too_many_requests")
ExecutionTimeExceeded("execution_time_exceeded")
string? ErrorMessage
class ToolSearchToolSearchResultBlock { Type = "tool_search_tool_search_result"; ToolReferences; }
JsonElement Type = "tool_search_tool_search_result"
required IReadOnlyList<ToolReferenceBlock> ToolReferences
JsonElement Type = "tool_reference"
required string ToolName
minLength1
maxLength256
pattern^[a-zA-Z0-9_-]{1,256}$
class ToolSearchToolSearchResultBlockParam { Type = "tool_search_tool_search_result"; ToolReferences; }
JsonElement Type = "tool_search_tool_search_result"
required IReadOnlyList<ToolReferenceBlockParam> ToolReferences
JsonElement Type = "tool_reference"
required string ToolName
minLength1
maxLength256
pattern^[a-zA-Z0-9_-]{1,256}$
CacheControlEphemeral? CacheControl

Create a cache control breakpoint at this content block.

JsonElement Type = "ephemeral"
Ttl Ttl

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

This may be one the following values:

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

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

One of the following:
Ttl5m("5m")
Ttl1h("1h")
class ToolTextEditor20250124 { Type = "text_editor_20250124"; Name; AllowedCallers; /* 4 more */ }
class ToolTextEditor20250429 { Type = "text_editor_20250429"; Name; AllowedCallers; /* 4 more */ }
class ToolTextEditor20250728 { Type = "text_editor_20250728"; Name; AllowedCallers; /* 5 more */ }
class ToolUnion: union
class ToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class ToolUseBlockParam { Type = "tool_use"; ID; Input; /* 4 more */ }
class ToolUseCaller: union

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

class DirectCaller { Type = "direct"; }

Tool invocation directly from the model.

JsonElement Type = "direct"
class ServerToolCaller { Type = "code_execution_20250825"; ToolID; }

Tool invocation generated by a server-side tool.

JsonElement Type = "code_execution_20250825"
required string ToolID
pattern^srvtoolu_[a-zA-Z0-9_]+$
class ServerToolCaller20260120 { Type = "code_execution_20260120"; ToolID; }
JsonElement Type = "code_execution_20260120"
required string ToolID
pattern^srvtoolu_[a-zA-Z0-9_]+$
class ToolsetToolUseBlock: union
class BrowserToolUseBlock: union
class ComputerToolUseBlock: union
class ToolUseBlock { Type = "tool_use"; ID; Caller; /* 3 more */ }
class UrlImageSource { Type = "url"; Url; }
JsonElement Type = "url"
required string Url
class UrlPdfSource { Type = "url"; Url; }
JsonElement Type = "url"
required string Url
class Usage { CacheCreation; CacheCreationInputTokens; CacheReadInputTokens; /* 6 more */ }
class UserLocation { Type = "approximate"; City; Country; /* 2 more */ }
JsonElement Type = "approximate"
string? City

The city of the user.

minLength1
maxLength255
string? Country

The two letter ISO country code of the user.

minLength2
maxLength2
string? Region

The region of the user.

minLength1
maxLength255
string? Timezone

The IANA timezone of the user.

minLength1
maxLength255
class WebFetchBlock { Type = "web_fetch_result"; Content; RetrievedAt; Url; }
JsonElement Type = "web_fetch_result"
required DocumentBlock Content
required string? RetrievedAt

ISO 8601 timestamp when the content was retrieved

required string Url

Fetched content URL

class WebFetchBlockParam { Type = "web_fetch_result"; Content; Url; RetrievedAt; }
JsonElement Type = "web_fetch_result"
required DocumentBlockParam Content
required string Url

Fetched content URL

string? RetrievedAt

ISO 8601 timestamp when the content was retrieved

class WebFetchTool20250910 { Type = "web_fetch_20250910"; Name; AllowedCallers; /* 9 more */ }
class WebFetchTool20260209 { Type = "web_fetch_20260209"; Name; AllowedCallers; /* 9 more */ }
class WebFetchTool20260309 { Type = "web_fetch_20260309"; Name; AllowedCallers; /* 10 more */ }

Web fetch tool with use_cache parameter for bypassing cached content.

class WebFetchTool20260318 { Type = "web_fetch_20260318"; Name; AllowedCallers; /* 11 more */ }
class WebFetchToolResultBlock { Type = "web_fetch_tool_result"; Caller; Content; ToolUseID; }
class WebFetchToolResultBlockParam { Type = "web_fetch_tool_result"; Content; ToolUseID; /* 2 more */ }
class WebFetchToolResultErrorBlock { Type = "web_fetch_tool_result_error"; ErrorCode; }
JsonElement Type = "web_fetch_tool_result_error"
required WebFetchToolResultErrorCode ErrorCode
One of the following:
InvalidToolInput("invalid_tool_input")
UrlTooLong("url_too_long")
UrlNotAllowed("url_not_allowed")
UrlNotInPriorContext("url_not_in_prior_context")
UrlNotAccessible("url_not_accessible")
UnsupportedContentType("unsupported_content_type")
TooManyRequests("too_many_requests")
MaxUsesExceeded("max_uses_exceeded")
Unavailable("unavailable")
ContentTooLarge("content_too_large")
class WebFetchToolResultErrorBlockParam { Type = "web_fetch_tool_result_error"; ErrorCode; }
JsonElement Type = "web_fetch_tool_result_error"
required WebFetchToolResultErrorCode ErrorCode
One of the following:
InvalidToolInput("invalid_tool_input")
UrlTooLong("url_too_long")
UrlNotAllowed("url_not_allowed")
UrlNotInPriorContext("url_not_in_prior_context")
UrlNotAccessible("url_not_accessible")
UnsupportedContentType("unsupported_content_type")
TooManyRequests("too_many_requests")
MaxUsesExceeded("max_uses_exceeded")
Unavailable("unavailable")
ContentTooLarge("content_too_large")
enum WebFetchToolResultErrorCode
InvalidToolInput("invalid_tool_input")
UrlTooLong("url_too_long")
UrlNotAllowed("url_not_allowed")
UrlNotInPriorContext("url_not_in_prior_context")
UrlNotAccessible("url_not_accessible")
UnsupportedContentType("unsupported_content_type")
TooManyRequests("too_many_requests")
MaxUsesExceeded("max_uses_exceeded")
Unavailable("unavailable")
ContentTooLarge("content_too_large")
class WebFetchUrlSourceAll { 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.

JsonElement Type = "all"
class WebFetchUrlSourceExcept { Type = "except"; Tools; }

The tool filter variant under which every result but the named tools' contributes.

JsonElement Type = "except"
required IReadOnlyList<WebFetchUrlSourceToolReference> Tools
JsonElement Type = "tool_reference"
required string Name
class WebFetchUrlSourceNone { Type = "none"; }

The url_sources variant under which a source contributes nothing: no result of the tool filter's source, or no user input.

JsonElement Type = "none"
class WebFetchUrlSourceOnly { Type = "only"; Tools; }

The tool filter variant under which only the named tools' results contribute.

JsonElement Type = "only"
required IReadOnlyList<WebFetchUrlSourceToolReference> Tools
JsonElement Type = "tool_reference"
required string Name
class WebFetchUrlSourceToolReference { Type = "tool_reference"; Name; }

One entry of a tool filter's tools: it must name a tool declared in this request's tools[].

JsonElement Type = "tool_reference"
required string Name
class WebFetchUrlSources { ClientToolResults; ServerToolResults; UserInput; }

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

class WebSearchResultBlock { Type = "web_search_result"; EncryptedContent; PageAge; /* 2 more */ }
JsonElement Type = "web_search_result"
required string EncryptedContent
required string? PageAge
required string Title
required string Url
class WebSearchResultBlockParam { Type = "web_search_result"; EncryptedContent; Title; /* 2 more */ }
JsonElement Type = "web_search_result"
required string EncryptedContent
required string Title
required string Url
string? PageAge
class WebSearchTool20250305 { Type = "web_search_20250305"; Name; AllowedCallers; /* 7 more */ }
class WebSearchTool20260209 { Type = "web_search_20260209"; Name; AllowedCallers; /* 7 more */ }
class WebSearchTool20260318 { Type = "web_search_20260318"; Name; AllowedCallers; /* 8 more */ }
class WebSearchToolRequestError { Type = "web_search_tool_result_error"; ErrorCode; }
JsonElement Type = "web_search_tool_result_error"
required WebSearchToolResultErrorCode ErrorCode
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
MaxUsesExceeded("max_uses_exceeded")
TooManyRequests("too_many_requests")
QueryTooLong("query_too_long")
RequestTooLarge("request_too_large")
class WebSearchToolResultBlock { Type = "web_search_tool_result"; Caller; Content; ToolUseID; }
class WebSearchToolResultBlockContent: union
class WebSearchToolResultBlockParam { Type = "web_search_tool_result"; Content; ToolUseID; /* 2 more */ }
class WebSearchToolResultBlockParamContent: union
class WebSearchToolResultError { Type = "web_search_tool_result_error"; ErrorCode; }
JsonElement Type = "web_search_tool_result_error"
required WebSearchToolResultErrorCode ErrorCode
One of the following:
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
MaxUsesExceeded("max_uses_exceeded")
TooManyRequests("too_many_requests")
QueryTooLong("query_too_long")
RequestTooLarge("request_too_large")
enum WebSearchToolResultErrorCode
InvalidToolInput("invalid_tool_input")
Unavailable("unavailable")
MaxUsesExceeded("max_uses_exceeded")
TooManyRequests("too_many_requests")
QueryTooLong("query_too_long")
RequestTooLarge("request_too_large")

MessagesBatches

Create a Message Batch
MessageBatch Messages.Batches.Create(parameters, cancellationToken = default)
POST/v1/messages/batches

Send a batch of Message creation requests.

Retrieve a Message Batch
MessageBatch Messages.Batches.Retrieve(parameters, cancellationToken = default)
GET/v1/messages/batches/{message_batch_id}

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
BatchListPage Messages.Batches.List(parameters, cancellationToken = default)
GET/v1/messages/batches

List all Message Batches within a Workspace. Most recently created batches are returned first.

Cancel a Message Batch
MessageBatch Messages.Batches.Cancel(parameters, cancellationToken = default)
POST/v1/messages/batches/{message_batch_id}/cancel

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
DeletedMessageBatch Messages.Batches.Delete(parameters, cancellationToken = default)
DELETE/v1/messages/batches/{message_batch_id}
Retrieve Message Batch results
IAsyncEnumerable<MessageBatchIndividualResponse> Messages.Batches.ResultsStreaming(parameters, cancellationToken = default)
GET/v1/messages/batches/{message_batch_id}/results

Streams the results of a Message Batch as a .jsonl file.