Claude Platform Docs

메시지

메시지 생성
client.Beta.Messages.New(ctx, params) (*BetaMessage, error)
POST/v1/messages

텍스트 및/또는 이미지 콘텐츠가 포함된 구조화된 입력 메시지 목록을 전송하면 모델이 대화의 다음 메시지를 생성합니다.

메시지의 토큰 수 계산
client.Beta.Messages.CountTokens(ctx, params) (*BetaMessageTokensCount, error)
POST/v1/messages/count_tokens

메시지의 토큰 수를 계산합니다.

Models
type BetaAdvisorMessageIterationUsage struct { Type: "advisor_message"; CacheCreation; CacheCreationInputTokens; /* 4 more */ }

Token usage for an advisor sub-inference iteration.

Type AdvisorMessage

Usage for an advisor sub-inference iteration

defaultadvisor_message
CacheCreation BetaCacheCreation

Breakdown of cached tokens by TTL

Ephemeral1hInputTokens int64

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

default0
minimum0
Ephemeral5mInputTokens int64

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

default0
minimum0
CacheCreationInputTokens int64

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

default0
minimum0
CacheReadInputTokens int64

The number of input tokens read from the cache.

default0
minimum0
InputTokens int64

The number of input tokens which were used.

minimum0
Model Model

The model that will complete your prompt.

See models for additional details and options.

One of the following:
OutputTokens int64

The number of output tokens which were used.

minimum0
type BetaAdvisorRedactedResultBlock struct { Type: "advisor_redacted_result"; EncryptedContent; StopReason }
Type AdvisorRedactedResult
defaultadvisor_redacted_result
EncryptedContent string

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

StopReason string

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

type BetaAdvisorRedactedResultBlockParam struct { Type: "advisor_redacted_result"; EncryptedContent; StopReason }
Type AdvisorRedactedResult
EncryptedContent string

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

StopReason string Optional
type BetaAdvisorResultBlock struct { Type: "advisor_result"; StopReason; Text }
Type AdvisorResult
defaultadvisor_result
StopReason string

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

Text string
type BetaAdvisorResultBlockParam struct { Type: "advisor_result"; Text; StopReason }
Type AdvisorResult
Text string
StopReason string Optional
type BetaAdvisorTool20260301 struct { Type: "advisor_20260301"; Model; Name; /* 7 more */ }
type BetaAdvisorToolResultBlock struct { Type: "advisor_tool_result"; Content; ToolUseID }
type BetaAdvisorToolResultBlockParam struct { Type: "advisor_tool_result"; Content; ToolUseID; CacheControl }
type BetaAdvisorToolResultError struct { Type: "advisor_tool_result_error"; ErrorCode }
Type AdvisorToolResultError
defaultadvisor_tool_result_error
ErrorCode BetaAdvisorToolResultErrorErrorCode
One of the following:
const BetaAdvisorToolResultErrorErrorCodeMaxUsesExceeded BetaAdvisorToolResultErrorErrorCode = "max_uses_exceeded"
const BetaAdvisorToolResultErrorErrorCodePromptTooLong BetaAdvisorToolResultErrorErrorCode = "prompt_too_long"
const BetaAdvisorToolResultErrorErrorCodeTooManyRequests BetaAdvisorToolResultErrorErrorCode = "too_many_requests"
const BetaAdvisorToolResultErrorErrorCodeOverloaded BetaAdvisorToolResultErrorErrorCode = "overloaded"
const BetaAdvisorToolResultErrorErrorCodeUnavailable BetaAdvisorToolResultErrorErrorCode = "unavailable"
const BetaAdvisorToolResultErrorErrorCodeExecutionTimeExceeded BetaAdvisorToolResultErrorErrorCode = "execution_time_exceeded"
const BetaAdvisorToolResultErrorErrorCodeModelNotFound BetaAdvisorToolResultErrorErrorCode = "model_not_found"
type BetaAdvisorToolResultErrorParam struct { Type: "advisor_tool_result_error"; ErrorCode }
Type AdvisorToolResultError
ErrorCode BetaAdvisorToolResultErrorParamErrorCode
One of the following:
const BetaAdvisorToolResultErrorParamErrorCodeMaxUsesExceeded BetaAdvisorToolResultErrorParamErrorCode = "max_uses_exceeded"
const BetaAdvisorToolResultErrorParamErrorCodePromptTooLong BetaAdvisorToolResultErrorParamErrorCode = "prompt_too_long"
const BetaAdvisorToolResultErrorParamErrorCodeTooManyRequests BetaAdvisorToolResultErrorParamErrorCode = "too_many_requests"
const BetaAdvisorToolResultErrorParamErrorCodeOverloaded BetaAdvisorToolResultErrorParamErrorCode = "overloaded"
const BetaAdvisorToolResultErrorParamErrorCodeUnavailable BetaAdvisorToolResultErrorParamErrorCode = "unavailable"
const BetaAdvisorToolResultErrorParamErrorCodeExecutionTimeExceeded BetaAdvisorToolResultErrorParamErrorCode = "execution_time_exceeded"
const BetaAdvisorToolResultErrorParamErrorCodeModelNotFound BetaAdvisorToolResultErrorParamErrorCode = "model_not_found"
type BetaAllThinkingTurnsParam struct { Type: "all" }
Type All
type BetaBase64ImageSourceParam struct { Type: "base64"; Data; MediaType }
Type Base64
Data string
formatbyte
MediaType BetaBase64ImageSourceMediaType
One of the following:
const BetaBase64ImageSourceMediaTypeImageJPEG BetaBase64ImageSourceMediaType = "image/jpeg"
const BetaBase64ImageSourceMediaTypeImagePNG BetaBase64ImageSourceMediaType = "image/png"
const BetaBase64ImageSourceMediaTypeImageGIF BetaBase64ImageSourceMediaType = "image/gif"
const BetaBase64ImageSourceMediaTypeImageWebP BetaBase64ImageSourceMediaType = "image/webp"
type BetaBase64PDFSource struct { Type: "base64"; Data; MediaType }
Type Base64
Data string
formatbyte
MediaType ApplicationPDF
type BetaBashCodeExecutionOutputBlock struct { Type: "bash_code_execution_output"; FileID }
Type BashCodeExecutionOutput
defaultbash_code_execution_output
FileID string
type BetaBashCodeExecutionOutputBlockParam struct { Type: "bash_code_execution_output"; FileID }
Type BashCodeExecutionOutput
FileID string
type BetaBashCodeExecutionResultBlock struct { Type: "bash_code_execution_result"; Content; ReturnCode; /* 2 more */ }
Type BashCodeExecutionResult
defaultbash_code_execution_result
Type BashCodeExecutionOutput
defaultbash_code_execution_output
FileID string
ReturnCode int64
Stderr string
Stdout string
type BetaBashCodeExecutionResultBlockParam struct { Type: "bash_code_execution_result"; Content; ReturnCode; /* 2 more */ }
Type BashCodeExecutionResult
Type BashCodeExecutionOutput
FileID string
ReturnCode int64
Stderr string
Stdout string
type BetaBashCodeExecutionToolResultBlock struct { Type: "bash_code_execution_tool_result"; Content; ToolUseID }
type BetaBashCodeExecutionToolResultBlockParam struct { Type: "bash_code_execution_tool_result"; Content; ToolUseID; CacheControl }
type BetaBashCodeExecutionToolResultError struct { Type: "bash_code_execution_tool_result_error"; ErrorCode }
Type BashCodeExecutionToolResultError
defaultbash_code_execution_tool_result_error
ErrorCode BetaBashCodeExecutionToolResultErrorErrorCode
One of the following:
const BetaBashCodeExecutionToolResultErrorErrorCodeInvalidToolInput BetaBashCodeExecutionToolResultErrorErrorCode = "invalid_tool_input"
const BetaBashCodeExecutionToolResultErrorErrorCodeUnavailable BetaBashCodeExecutionToolResultErrorErrorCode = "unavailable"
const BetaBashCodeExecutionToolResultErrorErrorCodeTooManyRequests BetaBashCodeExecutionToolResultErrorErrorCode = "too_many_requests"
const BetaBashCodeExecutionToolResultErrorErrorCodeExecutionTimeExceeded BetaBashCodeExecutionToolResultErrorErrorCode = "execution_time_exceeded"
const BetaBashCodeExecutionToolResultErrorErrorCodeOutputFileTooLarge BetaBashCodeExecutionToolResultErrorErrorCode = "output_file_too_large"
type BetaBashCodeExecutionToolResultErrorParam struct { Type: "bash_code_execution_tool_result_error"; ErrorCode }
Type BashCodeExecutionToolResultError
ErrorCode BetaBashCodeExecutionToolResultErrorParamErrorCode
One of the following:
const BetaBashCodeExecutionToolResultErrorParamErrorCodeInvalidToolInput BetaBashCodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input"
const BetaBashCodeExecutionToolResultErrorParamErrorCodeUnavailable BetaBashCodeExecutionToolResultErrorParamErrorCode = "unavailable"
const BetaBashCodeExecutionToolResultErrorParamErrorCodeTooManyRequests BetaBashCodeExecutionToolResultErrorParamErrorCode = "too_many_requests"
const BetaBashCodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded BetaBashCodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded"
const BetaBashCodeExecutionToolResultErrorParamErrorCodeOutputFileTooLarge BetaBashCodeExecutionToolResultErrorParamErrorCode = "output_file_too_large"
type BetaBrowserClickTargetUnion interface{…}

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

One of the following:
type BetaBrowserCoordinateTarget struct { Type: "coordinate"; X; Y }

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
type BetaBrowserRefTarget struct { Type: "ref"; Ref }

An element on the page, identified by a reference from a prior read_page or find result. References are scoped to the tab that produced them and become stale after navigation or a major re-render.

Type Ref
Ref string

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

type BetaBrowserCloseTabConfig struct { DeferLoading; Enabled }

close_tab's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserCloseTabInput struct { TabID }

Close the tab with the given tab_id.

TabID string

The tab to close.

type BetaBrowserCloseTabToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserCoordinateTarget struct { Type: "coordinate"; X; Y }

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
type BetaBrowserDoubleClickConfig struct { DeferLoading; Enabled }

double_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserDoubleClickInput struct { Target; Modifiers; TabID }

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

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

One of the following:
type BetaBrowserCoordinateTarget struct { Type: "coordinate"; X; Y }

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
type BetaBrowserRefTarget struct { Type: "ref"; Ref }

An element on the page, identified by a reference from a prior read_page or find result. References are scoped to the tab that produced them and become stale after navigation or a major re-render.

Type Ref
Ref string

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

Modifiers string Optional

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

TabID string Optional

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

type BetaBrowserDoubleClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserFileUploadConfig struct { DeferLoading; Enabled }

file_upload's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserFileUploadInput struct { Target; DocumentIDs; Paths; TabID }

Set the value of a file-input element to one or more files. The target must be an element reference; at least one of paths or document_ids is required.

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.

Type Ref
Ref string

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

DocumentIDs []string Optional

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

minItems1
Paths []string Optional

File paths on the browser executor's filesystem.

minItems1
TabID string Optional

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

type BetaBrowserFileUploadToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserFindConfig struct { DeferLoading; Enabled }

find's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserFindInput struct { Query; TabID }

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

Query string

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

TabID string Optional

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

type BetaBrowserFindToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserFormInputConfig struct { DeferLoading; Enabled }

form_input's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserFormInputInput struct { Target; Value; TabID }

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

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.

Type Ref
Ref string

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

The value to set.

One of the following:
string
float64
bool
TabID string Optional

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

type BetaBrowserFormInputToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserFormInputValueUnion interface{…}
One of the following:
string
float64
bool
type BetaBrowserGetPageTextConfig struct { DeferLoading; Enabled }

get_page_text's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserGetPageTextInput struct { TabID }

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

TabID string Optional

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

type BetaBrowserGetPageTextToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserHoldKeyConfig struct { DeferLoading; Enabled }

hold_key's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserHoldKeyInput struct { Duration; Text; TabID }

Hold a key or key chord down for a duration, then release it. Uses the same key names and "+" chord syntax as the key action.

Duration float64

Seconds to hold the key down (maximum 30).

minimum0
maximum30
Text string

The key or chord to hold.

TabID string Optional

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

type BetaBrowserHoldKeyToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserHoverConfig struct { DeferLoading; Enabled }

hover's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserHoverInput struct { Target; TabID }

Move the cursor to a coordinate or element without clicking.

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

One of the following:
type BetaBrowserCoordinateTarget struct { Type: "coordinate"; X; Y }

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
type BetaBrowserRefTarget struct { Type: "ref"; Ref }

An element on the page, identified by a reference from a prior read_page or find result. References are scoped to the tab that produced them and become stale after navigation or a major re-render.

Type Ref
Ref string

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

TabID string Optional

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

type BetaBrowserHoverToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserJavascriptExecConfig struct { DeferLoading; Enabled }

javascript_exec's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserJavascriptExecInput struct { Text; TabID }

Execute JavaScript in the page context and return the value of the last expression. The code runs with access to the DOM, window, and page variables. Write the expression you want evaluated — do NOT use return.

Text string

JavaScript to execute in the page context.

TabID string Optional

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

type BetaBrowserJavascriptExecToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserKeyConfig struct { DeferLoading; Enabled }

key's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserKeyInput struct { Text; Repeat; TabID }

Press a key or key chord. Use "+" to combine modifiers with a key (e.g. "ctrl+a", "cmd+shift+p") and space to sequence presses (e.g. "Backspace Backspace Delete"). Common names like "Return", "Tab", "Escape", "BackSpace" are supported.

Text string

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

Repeat int64 Optional

Number of times to repeat. Default 1.

minimum1
maximum100
TabID string Optional

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

type BetaBrowserKeyToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserLeftClickConfig struct { DeferLoading; Enabled }

left_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserLeftClickDragConfig struct { DeferLoading; Enabled }

left_click_drag's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserLeftClickDragInput struct { From; Target; TabID }

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

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
TabID string Optional

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

type BetaBrowserLeftClickDragToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserLeftClickInput struct { Target; Modifiers; TabID }

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

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

One of the following:
type BetaBrowserCoordinateTarget struct { Type: "coordinate"; X; Y }

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
type BetaBrowserRefTarget struct { Type: "ref"; Ref }

An element on the page, identified by a reference from a prior read_page or find result. References are scoped to the tab that produced them and become stale after navigation or a major re-render.

Type Ref
Ref string

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

Modifiers string Optional

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

TabID string Optional

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

type BetaBrowserLeftClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserLeftMouseDownConfig struct { DeferLoading; Enabled }

left_mouse_down's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserLeftMouseDownInput struct { Target; TabID }

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

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
TabID string Optional

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

type BetaBrowserLeftMouseDownToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserLeftMouseUpConfig struct { DeferLoading; Enabled }

left_mouse_up's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserLeftMouseUpInput struct { Target; TabID }

Release the left mouse button at a viewport coordinate.

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
TabID string Optional

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

type BetaBrowserLeftMouseUpToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserListTabsConfig struct { DeferLoading; Enabled }

list_tabs's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserListTabsInput struct{…}

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

type BetaBrowserListTabsToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserMiddleClickConfig struct { DeferLoading; Enabled }

middle_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserMiddleClickInput struct { Target; Modifiers; TabID }

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

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

One of the following:
type BetaBrowserCoordinateTarget struct { Type: "coordinate"; X; Y }

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
type BetaBrowserRefTarget struct { Type: "ref"; Ref }

An element on the page, identified by a reference from a prior read_page or find result. References are scoped to the tab that produced them and become stale after navigation or a major re-render.

Type Ref
Ref string

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

Modifiers string Optional

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

TabID string Optional

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

type BetaBrowserMiddleClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserMouseMoveConfig struct { DeferLoading; Enabled }

mouse_move's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserMouseMoveInput struct { Target; TabID }

Move the pointer to a viewport coordinate without clicking.

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
TabID string Optional

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

type BetaBrowserMouseMoveToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserNavigateConfig struct { DeferLoading; Enabled }

navigate's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserNavigateInput struct { URL; TabID }

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

URL string

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

TabID string Optional

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

type BetaBrowserNavigateToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserNewTabConfig struct { DeferLoading; Enabled }

new_tab's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserNewTabInput struct{…}

Open a new empty tab and return its tab_id.

type BetaBrowserNewTabToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserReadConsoleConfig struct { DeferLoading; Enabled }

read_console's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserReadConsoleInput struct { TabID }

Return console output (log entries, errors, warnings) accumulated since the driver attached to the tab and since the last read, one line per entry. An empty result does not mean no traffic for a tab that predates attach.

TabID string Optional

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

type BetaBrowserReadConsoleToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserReadNetworkConfig struct { DeferLoading; Enabled }

read_network's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserReadNetworkInput struct { TabID }

Return the network requests (method, URL, status, MIME type, timing) recorded since the driver attached to the tab and since the last read, one line per entry. An empty result does not mean no traffic for a tab that predates attach.

TabID string Optional

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

type BetaBrowserReadNetworkToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserReadPageConfig struct { DeferLoading; Enabled }

read_page's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserReadPageFilter string
One of the following:
const BetaBrowserReadPageFilterAll BetaBrowserReadPageFilter = "all"
const BetaBrowserReadPageFilterInteractive BetaBrowserReadPageFilter = "interactive"
type BetaBrowserReadPageInput struct { Depth; Filter; Ref; TabID }

Return a structured accessibility tree of the page (or the subtree rooted at ref), with element references like [ref_7] that can be used as targets on later actions. Output is capped at 50,000 characters — narrow with ref or a smaller depth when exceeded.

Depth int64 Optional

Maximum tree depth. Default 15.

minimum1
Filter BetaBrowserReadPageFilter Optional

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

One of the following:
const BetaBrowserReadPageFilterAll BetaBrowserReadPageFilter = "all"
const BetaBrowserReadPageFilterInteractive BetaBrowserReadPageFilter = "interactive"
Ref string Optional

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

TabID string Optional

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

type BetaBrowserReadPageToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserRefTarget struct { Type: "ref"; Ref }

An element on the page, identified by a reference from a prior read_page or find result. References are scoped to the tab that produced them and become stale after navigation or a major re-render.

Type Ref
Ref string

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

type BetaBrowserRightClickConfig struct { DeferLoading; Enabled }

right_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserRightClickInput struct { Target; Modifiers; TabID }

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

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

One of the following:
type BetaBrowserCoordinateTarget struct { Type: "coordinate"; X; Y }

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
type BetaBrowserRefTarget struct { Type: "ref"; Ref }

An element on the page, identified by a reference from a prior read_page or find result. References are scoped to the tab that produced them and become stale after navigation or a major re-render.

Type Ref
Ref string

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

Modifiers string Optional

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

TabID string Optional

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

type BetaBrowserRightClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserScreenshotConfig struct { DeferLoading; Enabled }

screenshot's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserScreenshotInput struct { TabID }

Capture the current browser viewport.

TabID string Optional

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

type BetaBrowserScreenshotToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserScrollConfig struct { DeferLoading; Enabled }

scroll's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserScrollDirection string
One of the following:
const BetaBrowserScrollDirectionUp BetaBrowserScrollDirection = "up"
const BetaBrowserScrollDirectionDown BetaBrowserScrollDirection = "down"
const BetaBrowserScrollDirectionLeft BetaBrowserScrollDirection = "left"
const BetaBrowserScrollDirectionRight BetaBrowserScrollDirection = "right"
type BetaBrowserScrollInput struct { ScrollDirection; Target; ScrollAmount; TabID }

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

ScrollDirection BetaBrowserScrollDirection
One of the following:
const BetaBrowserScrollDirectionUp BetaBrowserScrollDirection = "up"
const BetaBrowserScrollDirectionDown BetaBrowserScrollDirection = "down"
const BetaBrowserScrollDirectionLeft BetaBrowserScrollDirection = "left"
const BetaBrowserScrollDirectionRight BetaBrowserScrollDirection = "right"

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
ScrollAmount int64 Optional

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

minimum1
maximum10
TabID string Optional

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

type BetaBrowserScrollToConfig struct { DeferLoading; Enabled }

scroll_to's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserScrollToInput struct { Target; TabID }

Scroll an element into view.

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.

Type Ref
Ref string

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

TabID string Optional

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

type BetaBrowserScrollToToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserScrollToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserStateBlockParam struct { Type: "browser_state"; Tabs; CacheControl; StateChanges }

The caller's browser state after a browser toolset member call — the full inventory of open tabs, which tab is active, and any side effects (tabs opened, download state changes) the call produced.

At most one per tool_result, only on a non-error result answering a browser toolset member tool_use. The server renders the model-visible text from it; the model never sees the raw fields.

type BetaBrowserStateChangeUnionParam interface{…}
One of the following:
type BetaBrowserStateChangeDownloadCompletedParam struct { Type: "download_completed"; DownloadID; URL; /* 2 more */ }

A file download that finished during this call, reported with the same download_id as its download_started — or without a prior download_started, when the download finished during the call that started it (at most one state change per download_id per result).

Type DownloadCompleted
DownloadID string

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

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

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

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

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]*$
SizeBytes int64 Optional

The completed download's size.

minimum0
type BetaBrowserStateChangeDownloadFailedParam struct { Type: "download_failed"; DownloadID; URL; Error }

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

Type DownloadFailed
DownloadID string

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

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

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

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

The failure or cancellation detail, when known.

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
type BetaBrowserStateChangeDownloadStartedParam struct { Type: "download_started"; DownloadID; URL }

A file download that started during this call.

Type DownloadStarted
DownloadID string

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

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

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

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
type BetaBrowserStateChangeTabOpenedParam struct { Type: "tab_opened"; TabID }

A tab this call's execution opened that remains open at its end — the creation delta of the tabs inventory, not an event log.

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.

Type TabOpened
TabID string

The tab_id of the opened tab, present in tabs.

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

TabID string

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

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

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

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

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

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

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

type BetaBrowserSwitchTabConfig struct { DeferLoading; Enabled }

switch_tab's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserSwitchTabInput struct { TabID }

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

TabID string

The tab to switch to.

type BetaBrowserSwitchTabToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserToolUseBlockUnion interface{…}
One of the following:
type BetaBrowserToolset20260801 struct { Type: "browser_toolset_20260801"; CacheControl; Configs }

The browser toolset: a single tools[] entry (carrying no name) that declares the browser tool family. The model is served the family's tool with any members disabled via configs removed from its schema.

Type BrowserToolset20260801
CacheControl BetaCacheControlEphemeral Optional

Create a cache control breakpoint at this content block.

Type Ephemeral
TTL BetaCacheControlEphemeralTTL Optional

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:
const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
Configs BetaBrowserToolsetConfigs Optional

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

type BetaBrowserToolsetConfigs struct { Type; CloseTab; DoubleClick; /* 28 more */ }

Per-member configuration for browser_toolset_20260801: one optional field per member tool, keyed by the member name — the same name the member's tool_use blocks carry. Every member is an accepted key, and a member's defaults apply wherever its key is absent. Unknown keys are rejected: the field set is this toolset version's complete member set.

type BetaBrowserTripleClickConfig struct { DeferLoading; Enabled }

triple_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserTripleClickInput struct { Target; Modifiers; TabID }

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

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

One of the following:
type BetaBrowserCoordinateTarget struct { Type: "coordinate"; X; Y }

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

Type Coordinate
X int64

Pixels from the left edge of the viewport.

minimum0
Y int64

Pixels from the top edge of the viewport.

minimum0
type BetaBrowserRefTarget struct { Type: "ref"; Ref }

An element on the page, identified by a reference from a prior read_page or find result. References are scoped to the tab that produced them and become stale after navigation or a major re-render.

Type Ref
Ref string

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

Modifiers string Optional

Optional modifier key chord to hold for the duration of this action (e.g. "shift", "ctrl+shift", "cmd+alt").

TabID string Optional

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

type BetaBrowserTripleClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserTypeConfig struct { DeferLoading; Enabled }

type's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserTypeInput struct { Text; TabID }

Type a literal string at the current focus.

Text string

The text to type.

TabID string Optional

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

type BetaBrowserTypeToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserWaitConfig struct { DeferLoading; Enabled }

wait's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserWaitInput struct { Duration; TabID }

Pause for the given duration.

Duration float64

Seconds to wait (maximum 30).

minimum0
maximum30
TabID string Optional

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

type BetaBrowserWaitToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaBrowserZoomConfig struct { DeferLoading; Enabled }

zoom's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaBrowserZoomInput struct { Region; TabID }

Return a cropped screenshot of the given viewport region, scaled up for closer inspection — useful for small icons, buttons, or text. Coordinates are in the same viewport-pixel space as a full screenshot.

Region []int64

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

minItems4
maxItems4
TabID string Optional

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

type BetaBrowserZoomToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaCacheControlEphemeral struct { Type: "ephemeral"; TTL }
Type Ephemeral
TTL BetaCacheControlEphemeralTTL Optional

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:
const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
type BetaCacheCreation struct { Ephemeral1hInputTokens; Ephemeral5mInputTokens }
Ephemeral1hInputTokens int64

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

default0
minimum0
Ephemeral5mInputTokens int64

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

default0
minimum0
type BetaCacheMissMessagesChanged struct { Type: "messages_changed"; CacheMissedInputTokens }
Type MessagesChanged
defaultmessages_changed
CacheMissedInputTokens int64

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

type BetaCacheMissModelChanged struct { Type: "model_changed"; CacheMissedInputTokens }
Type ModelChanged
defaultmodel_changed
CacheMissedInputTokens int64

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

type BetaCacheMissPreviousMessageNotFound struct { Type: "previous_message_not_found" }
Type PreviousMessageNotFound
defaultprevious_message_not_found
type BetaCacheMissReasonUnion interface{…}
One of the following:
type BetaCacheMissSystemChanged struct { Type: "system_changed"; CacheMissedInputTokens }
Type SystemChanged
defaultsystem_changed
CacheMissedInputTokens int64

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

type BetaCacheMissToolsChanged struct { Type: "tools_changed"; CacheMissedInputTokens }
Type ToolsChanged
defaulttools_changed
CacheMissedInputTokens int64

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

type BetaCacheMissUnavailable struct { Type: "unavailable" }
Type Unavailable
defaultunavailable
type BetaCitationCharLocation struct { Type: "char_location"; CitedText; DocumentIndex; /* 4 more */ }
Type CharLocation
defaultchar_location
CitedText string
DocumentIndex int64
minimum0
DocumentTitle string
EndCharIndex int64
FileID string
StartCharIndex int64
minimum0
type BetaCitationCharLocationParam struct { Type: "char_location"; CitedText; DocumentIndex; /* 3 more */ }
Type CharLocation
CitedText string
DocumentIndex int64
minimum0
DocumentTitle string
minLength1
maxLength500
EndCharIndex int64
StartCharIndex int64
minimum0
type BetaCitationConfig struct { Enabled }
Enabled bool
defaultfalse
type BetaCitationContentBlockLocation struct { Type: "content_block_location"; CitedText; DocumentIndex; /* 4 more */ }
Type ContentBlockLocation
defaultcontent_block_location
CitedText string

The full text of the cited block range, concatenated.

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

DocumentIndex int64
minimum0
DocumentTitle string
EndBlockIndex int64

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.

FileID string
StartBlockIndex int64

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

minimum0
type BetaCitationContentBlockLocationParam struct { Type: "content_block_location"; CitedText; DocumentIndex; /* 3 more */ }
Type ContentBlockLocation
CitedText string

The full text of the cited block range, concatenated.

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

DocumentIndex int64
minimum0
DocumentTitle string
minLength1
maxLength500
EndBlockIndex int64

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

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

StartBlockIndex int64

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

minimum0
type BetaCitationPageLocation struct { Type: "page_location"; CitedText; DocumentIndex; /* 4 more */ }
Type PageLocation
defaultpage_location
CitedText string
DocumentIndex int64
minimum0
DocumentTitle string
EndPageNumber int64
FileID string
StartPageNumber int64
minimum1
type BetaCitationPageLocationParam struct { Type: "page_location"; CitedText; DocumentIndex; /* 3 more */ }
Type PageLocation
CitedText string
DocumentIndex int64
minimum0
DocumentTitle string
minLength1
maxLength500
EndPageNumber int64
StartPageNumber int64
minimum1
type BetaCitationSearchResultLocation struct { Type: "search_result_location"; CitedText; EndBlockIndex; /* 4 more */ }
Type SearchResultLocation
defaultsearch_result_location
CitedText string

The full text of the cited block range, concatenated.

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

EndBlockIndex int64

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

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

SearchResultIndex int64

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
Source string
StartBlockIndex int64

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

minimum0
Title string
type BetaCitationSearchResultLocationParam struct { Type: "search_result_location"; CitedText; EndBlockIndex; /* 4 more */ }
Type SearchResultLocation
CitedText string

The full text of the cited block range, concatenated.

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

EndBlockIndex int64

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

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

SearchResultIndex int64

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
Source string
StartBlockIndex int64

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

minimum0
Title string
type BetaCitationWebSearchResultLocationParam struct { Type: "web_search_result_location"; CitedText; EncryptedIndex; /* 2 more */ }
Type WebSearchResultLocation
CitedText string
EncryptedIndex string
Title string
minLength1
maxLength512
URL string
minLength1
type BetaCitationsConfigParamResp struct { Enabled }
Enabled bool Optional
type BetaCitationsDelta struct { Type: "citations_delta"; Citation }
type BetaCitationsWebSearchResultLocation struct { Type: "web_search_result_location"; CitedText; EncryptedIndex; /* 2 more */ }
Type WebSearchResultLocation
defaultweb_search_result_location
CitedText string
EncryptedIndex string
Title string
maxLength512
URL string
type BetaClearThinking20251015EditParam struct { Type: "clear_thinking_20251015"; Keep }
Type ClearThinking20251015
Keep BetaClearThinking20251015EditKeepUnionParam Optional

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

One of the following:
type BetaThinkingTurnsParam struct { Type: "thinking_turns"; Value }
Type ThinkingTurns
Value int64
minimum1
type BetaAllThinkingTurnsParam struct { Type: "all" }
Type All
All
type BetaClearThinking20251015EditResponse struct { Type: "clear_thinking_20251015"; ClearedInputTokens; ClearedThinkingTurns }
Type ClearThinking20251015

The type of context management edit applied.

defaultclear_thinking_20251015
ClearedInputTokens int64

Number of input tokens cleared by this edit.

minimum0
ClearedThinkingTurns int64

Number of thinking turns that were cleared.

minimum0
type BetaClearToolUses20250919EditParam struct { Type: "clear_tool_uses_20250919"; ClearAtLeast; ClearToolInputs; /* 3 more */ }
type BetaClearToolUses20250919EditResponse struct { Type: "clear_tool_uses_20250919"; ClearedInputTokens; ClearedToolUses }
Type ClearToolUses20250919

The type of context management edit applied.

defaultclear_tool_uses_20250919
ClearedInputTokens int64

Number of input tokens cleared by this edit.

minimum0
ClearedToolUses int64

Number of tool uses that were cleared.

minimum0
type BetaCodeExecutionOutputBlock struct { Type: "code_execution_output"; FileID }
Type CodeExecutionOutput
defaultcode_execution_output
FileID string
type BetaCodeExecutionOutputBlockParam struct { Type: "code_execution_output"; FileID }
Type CodeExecutionOutput
FileID string
type BetaCodeExecutionResultBlock struct { Type: "code_execution_result"; Content; ReturnCode; /* 2 more */ }
Type CodeExecutionResult
defaultcode_execution_result
Type CodeExecutionOutput
defaultcode_execution_output
FileID string
ReturnCode int64
Stderr string
Stdout string
type BetaCodeExecutionResultBlockParam struct { Type: "code_execution_result"; Content; ReturnCode; /* 2 more */ }
Type CodeExecutionResult
Type CodeExecutionOutput
FileID string
ReturnCode int64
Stderr string
Stdout string
type BetaCodeExecutionTool20250522 struct { Type: "code_execution_20250522"; Name; AllowedCallers; /* 3 more */ }
type BetaCodeExecutionTool20250825 struct { Type: "code_execution_20250825"; Name; AllowedCallers; /* 3 more */ }
type BetaCodeExecutionTool20260120 struct { Type: "code_execution_20260120"; Name; AllowedCallers; /* 3 more */ }

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

type BetaCodeExecutionTool20260521 struct { Type: "code_execution_20260521"; Name; AllowedCallers; /* 3 more */ }

Code execution tool with REPL state persistence.

type BetaCodeExecutionToolResultBlock struct { Type: "code_execution_tool_result"; Content; ToolUseID }
Type CodeExecutionToolResult
defaultcode_execution_tool_result
One of the following:
ToolUseID string
pattern^srvtoolu_[a-zA-Z0-9_]+$
type BetaCodeExecutionToolResultBlockContentUnion interface{…}
One of the following:
type BetaCodeExecutionToolResultBlockParam struct { Type: "code_execution_tool_result"; Content; ToolUseID; CacheControl }
Type CodeExecutionToolResult
One of the following:
ToolUseID string
pattern^srvtoolu_[a-zA-Z0-9_]+$
CacheControl BetaCacheControlEphemeralParam Optional

Create a cache control breakpoint at this content block.

Type Ephemeral
TTL BetaCacheControlEphemeralTTL Optional

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:
const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
type BetaCodeExecutionToolResultBlockParamContentUnion interface{…}
One of the following:
type BetaCodeExecutionToolResultError struct { Type: "code_execution_tool_result_error"; ErrorCode }
Type CodeExecutionToolResultError
defaultcode_execution_tool_result_error
One of the following:
const BetaCodeExecutionToolResultErrorCodeInvalidToolInput BetaCodeExecutionToolResultErrorCode = "invalid_tool_input"
const BetaCodeExecutionToolResultErrorCodeUnavailable BetaCodeExecutionToolResultErrorCode = "unavailable"
const BetaCodeExecutionToolResultErrorCodeTooManyRequests BetaCodeExecutionToolResultErrorCode = "too_many_requests"
const BetaCodeExecutionToolResultErrorCodeExecutionTimeExceeded BetaCodeExecutionToolResultErrorCode = "execution_time_exceeded"
type BetaCodeExecutionToolResultErrorCode string
One of the following:
const BetaCodeExecutionToolResultErrorCodeInvalidToolInput BetaCodeExecutionToolResultErrorCode = "invalid_tool_input"
const BetaCodeExecutionToolResultErrorCodeUnavailable BetaCodeExecutionToolResultErrorCode = "unavailable"
const BetaCodeExecutionToolResultErrorCodeTooManyRequests BetaCodeExecutionToolResultErrorCode = "too_many_requests"
const BetaCodeExecutionToolResultErrorCodeExecutionTimeExceeded BetaCodeExecutionToolResultErrorCode = "execution_time_exceeded"
type BetaCodeExecutionToolResultErrorParam struct { Type: "code_execution_tool_result_error"; ErrorCode }
Type CodeExecutionToolResultError
One of the following:
const BetaCodeExecutionToolResultErrorCodeInvalidToolInput BetaCodeExecutionToolResultErrorCode = "invalid_tool_input"
const BetaCodeExecutionToolResultErrorCodeUnavailable BetaCodeExecutionToolResultErrorCode = "unavailable"
const BetaCodeExecutionToolResultErrorCodeTooManyRequests BetaCodeExecutionToolResultErrorCode = "too_many_requests"
const BetaCodeExecutionToolResultErrorCodeExecutionTimeExceeded BetaCodeExecutionToolResultErrorCode = "execution_time_exceeded"
type BetaCompact20260112EditParam struct { Type: "compact_20260112"; Instructions; PauseAfterCompaction; Trigger }

Automatically compact older context when reaching the configured trigger threshold.

Type Compact20260112
Instructions string Optional

Additional instructions for summarization.

PauseAfterCompaction bool Optional

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

Trigger BetaInputTokensTriggerParam Optional

When to trigger compaction. Defaults to 150000 input tokens.

Type InputTokens
Value int64
minimum1
type BetaCompactionBlock struct { Type: "compaction"; Content; EncryptedContent; /* 2 more */ }

A compaction block returned when autocompact is triggered.

When content is None, it indicates the compaction failed to produce a valid summary (e.g., malformed output from the model). Clients may round-trip compaction blocks with null content; the server treats them as no-ops.

Type Compaction
defaultcompaction
Content string

Summary of compacted content, or null if compaction failed

EncryptedContent string

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

Signature string Optional

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

ToolChanges []BetaCompactionBlockToolChangeUnion Optional

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

One of the following:
type BetaResponseToolAdditionBlock struct { Type: "tool_addition"; Tool }

An entry of a compaction block's tool_changes: a tool the compacted range made available, as a reference to a tools entry or MCP toolset, or as the tool definition in effect at the end of the range, by value. Send it back unchanged.

type BetaResponseToolRemovalBlock struct { Type: "tool_removal"; Tool }

An entry of a compaction block's tool_changes: a tool of the request's tools (or an MCP tool or toolset) that the compacted range withdrew. Send it back unchanged.

type BetaCompactionBlockParam struct { Type: "compaction"; CacheControl; Content; /* 3 more */ }

A compaction block containing summary of previous context.

Users should round-trip these blocks from responses to subsequent requests to maintain context across compaction boundaries.

When content is None, the block represents a failed compaction. The server treats these as no-ops. Empty string content is not allowed.

type BetaCompactionConfigParam struct { Type: "summarize"; Instructions }

Compact the whole conversation and return a signed compaction block, alone, that a later request sends back first in messages, in place of the messages it summarizes. There is no trigger and no pause flag: sending the parameter compacts, and nothing is sampled after the block.

The summarization prompt is the server's own unless instructions are given, which then replace it for this request; a value that is empty or only whitespace counts as absent.

Type Summarize
Instructions string Optional

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

maxLength16384
type BetaCompactionContentBlockDelta struct { Type: "compaction_delta"; Content; EncryptedContent }
Type CompactionDelta
defaultcompaction_delta
Content string
EncryptedContent string

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

type BetaCompactionIterationUsage struct { Type: "compaction"; CacheCreation; CacheCreationInputTokens; /* 3 more */ }

Token usage for a compaction iteration.

Type Compaction

Usage for a compaction iteration

defaultcompaction
CacheCreation BetaCacheCreation

Breakdown of cached tokens by TTL

Ephemeral1hInputTokens int64

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

default0
minimum0
Ephemeral5mInputTokens int64

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

default0
minimum0
CacheCreationInputTokens int64

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

default0
minimum0
CacheReadInputTokens int64

The number of input tokens read from the cache.

default0
minimum0
InputTokens int64

The number of input tokens which were used.

minimum0
OutputTokens int64

The number of output tokens which were used.

minimum0
type BetaComputerCursorPositionConfig struct { DeferLoading; Enabled }

cursor_position's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerCursorPositionInput struct{…}

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

type BetaComputerCursorPositionToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerDoubleClickConfig struct { DeferLoading; Enabled }

double_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerDoubleClickInput struct { Coordinate; Text }

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

Coordinate []int64 Optional

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

minItems2
maxItems2
Text string Optional

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

type BetaComputerDoubleClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerHoldKeyConfig struct { DeferLoading; Enabled }

hold_key's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerHoldKeyInput struct { Duration; Text }

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

Duration int64

Duration to hold the key, in seconds.

maximum300
Text string

The key or key-combination to hold.

type BetaComputerHoldKeyToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerKeyConfig struct { DeferLoading; Enabled }

key's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerKeyInput struct { Text; Repeat }

Press a key or key-combination on the keyboard. Use "+" to combine modifiers with a key (e.g. "ctrl+s", "alt+Tab", "ctrl+shift+Escape"). Key names are case-insensitive; common names like "Return", "Tab", "Escape", "Up", "Down", "Left", "Right", "Home", "End", "Page_Up", "Page_Down", "Delete", "BackSpace" are supported.

Text string

The key or key-combination to press.

Repeat int64 Optional

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

minimum1
maximum100
type BetaComputerKeyToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerLeftClickConfig struct { DeferLoading; Enabled }

left_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerLeftClickDragConfig struct { DeferLoading; Enabled }

left_click_drag's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerLeftClickDragInput struct { Coordinate; StartCoordinate; Text }

Click and drag the cursor from start_coordinate to coordinate.

Coordinate []int64

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

minItems2
maxItems2
StartCoordinate []int64

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

minItems2
maxItems2
Text string Optional

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

type BetaComputerLeftClickDragToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerLeftClickInput struct { Coordinate; Text }

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

Coordinate []int64 Optional

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

minItems2
maxItems2
Text string Optional

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

type BetaComputerLeftClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerLeftMouseDownConfig struct { DeferLoading; Enabled }

left_mouse_down's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerLeftMouseDownInput struct{…}

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

type BetaComputerLeftMouseDownToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerLeftMouseUpConfig struct { DeferLoading; Enabled }

left_mouse_up's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerLeftMouseUpInput struct{…}

Release the left mouse button.

type BetaComputerLeftMouseUpToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerMiddleClickConfig struct { DeferLoading; Enabled }

middle_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerMiddleClickInput struct { Coordinate; Text }

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

Coordinate []int64 Optional

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

minItems2
maxItems2
Text string Optional

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

type BetaComputerMiddleClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerMouseMoveConfig struct { DeferLoading; Enabled }

mouse_move's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerMouseMoveInput struct { Coordinate }

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

Coordinate []int64

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

minItems2
maxItems2
type BetaComputerMouseMoveToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerRightClickConfig struct { DeferLoading; Enabled }

right_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerRightClickInput struct { Coordinate; Text }

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

Coordinate []int64 Optional

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

minItems2
maxItems2
Text string Optional

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

type BetaComputerRightClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerScreenshotConfig struct { DeferLoading; Enabled }

screenshot's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerScreenshotInput struct{…}

Take a screenshot of the screen.

type BetaComputerScreenshotToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerScrollConfig struct { DeferLoading; Enabled }

scroll's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerScrollDirection string
One of the following:
const BetaComputerScrollDirectionUp BetaComputerScrollDirection = "up"
const BetaComputerScrollDirectionDown BetaComputerScrollDirection = "down"
const BetaComputerScrollDirectionLeft BetaComputerScrollDirection = "left"
const BetaComputerScrollDirectionRight BetaComputerScrollDirection = "right"
type BetaComputerScrollInput struct { ScrollAmount; ScrollDirection; Coordinate; Text }

Scroll the screen at the specified (x, y) pixel coordinate, or the current cursor position if coordinate is omitted. Do NOT use PageUp/PageDown to scroll.

ScrollAmount int64

Number of 'clicks' of the scroll wheel.

ScrollDirection BetaComputerScrollDirection
One of the following:
const BetaComputerScrollDirectionUp BetaComputerScrollDirection = "up"
const BetaComputerScrollDirectionDown BetaComputerScrollDirection = "down"
const BetaComputerScrollDirectionLeft BetaComputerScrollDirection = "left"
const BetaComputerScrollDirectionRight BetaComputerScrollDirection = "right"
Coordinate []int64 Optional

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

minItems2
maxItems2
Text string Optional

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

type BetaComputerScrollToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerToolUseBlockUnion interface{…}
One of the following:
type BetaComputerToolset20260801 struct { Type: "computer_toolset_20260801"; CacheControl; Configs }

The computer toolset: a single tools[] entry (carrying no name) that declares the computer tool family. The model is served the family's tool with any members disabled via configs removed from its schema. Every member is enabled by default, zoom included. The single-tool options display_number and enable_zoom are not fields of a toolset entry — it carries only type, configs, and cache_control; zoom is controlled via configs.zoom.enabled.

Type ComputerToolset20260801
CacheControl BetaCacheControlEphemeral Optional

Create a cache control breakpoint at this content block.

Type Ephemeral
TTL BetaCacheControlEphemeralTTL Optional

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:
const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
Configs BetaComputerToolsetConfigs Optional

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

type BetaComputerToolsetConfigs struct { Type; CursorPosition; DoubleClick; /* 14 more */ }

Per-member configuration for computer_toolset_20260801: one optional field per member tool, keyed by the member name — the same name the member's tool_use blocks carry. Every member is an accepted key, and a member's defaults apply wherever its key is absent. Unknown keys are rejected: the field set is this toolset version's complete member set.

type BetaComputerTripleClickConfig struct { DeferLoading; Enabled }

triple_click's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerTripleClickInput struct { Coordinate; Text }

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

Coordinate []int64 Optional

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

minItems2
maxItems2
Text string Optional

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

type BetaComputerTripleClickToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerTypeConfig struct { DeferLoading; Enabled }

type's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerTypeInput struct { Text }

Type a string of text on the keyboard.

Text string

The text to type.

type BetaComputerTypeToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerWaitConfig struct { DeferLoading; Enabled }

wait's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerWaitInput struct { Duration }

Wait for a specified duration.

Duration int64

Duration to wait, in seconds.

maximum300
type BetaComputerWaitToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaComputerZoomConfig struct { DeferLoading; Enabled }

zoom's config overrides.

DeferLoading bool Optional

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

Enabled bool Optional

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

type BetaComputerZoomInput struct { Region }

Take a screenshot of a rectangular region. Region coordinates are in the full-screenshot space (not physical display pixels). The crop is scaled up to fill the image budget so fine details become legible.

Region []int64

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

minItems4
maxItems4
type BetaComputerZoomToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaContainer struct { ID; ExpiresAt; Skills }

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

ID string

Identifier for the container used in this request

ExpiresAt Time

The time at which the container will expire.

formatdate-time
Skills []BetaContainerSkill

Skills loaded in the container

Type BetaContainerSkillType

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

One of the following:
const BetaContainerSkillTypeAnthropic BetaContainerSkillType = "anthropic"
const BetaContainerSkillTypeCustom BetaContainerSkillType = "custom"
SkillID string

Skill ID

minLength1
maxLength64
Version string

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

minLength1
maxLength64
type BetaContainerParams struct { ID; Skills }

Container parameters with skills to be loaded.

ID string Optional

Container id

Skills []BetaSkillParams Optional

List of skills to load in the container

maxItems20
Type BetaSkillParamsType

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

One of the following:
const BetaSkillParamsTypeAnthropic BetaSkillParamsType = "anthropic"
const BetaSkillParamsTypeCustom BetaSkillParamsType = "custom"
SkillID string

Skill ID

minLength1
maxLength64
Version string Optional

Skill version or 'latest' for most recent version

minLength1
maxLength64
type BetaContainerSkill struct { Type; SkillID; Version }

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

Type BetaContainerSkillType

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

One of the following:
const BetaContainerSkillTypeAnthropic BetaContainerSkillType = "anthropic"
const BetaContainerSkillTypeCustom BetaContainerSkillType = "custom"
SkillID string

Skill ID

minLength1
maxLength64
Version string

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

minLength1
maxLength64
type BetaContainerUploadBlock struct { Type: "container_upload"; FileID }

Response model for a file uploaded to the container.

Type ContainerUpload
defaultcontainer_upload
FileID string
type BetaContainerUploadBlockParam struct { Type: "container_upload"; FileID; CacheControl }

A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory.

Type ContainerUpload
FileID string
CacheControl BetaCacheControlEphemeralParam Optional

Create a cache control breakpoint at this content block.

Type Ephemeral
TTL BetaCacheControlEphemeralTTL Optional

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:
const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
type BetaContentBlockUnion interface{…}
One of the following:
type BetaContentBlockParamUnion interface{…}
One of the following:
type BetaContentBlockSourceParam struct { Type: "content"; Content }
Type Content
Content BetaContentBlockSourceContentUnionParam
One of the following:
string
One of the following:
type BetaTextBlockParam struct { Type: "text"; Text; CacheControl; Citations }
type BetaImageBlockParam struct { Type: "image"; Source; CacheControl; Transformations }
type BetaContentBlockSourceContentUnionParam interface{…}
One of the following:
type BetaTextBlockParam struct { Type: "text"; Text; CacheControl; Citations }
type BetaImageBlockParam struct { Type: "image"; Source; CacheControl; Transformations }
type BetaContextManagementConfigParam struct { Edits }
type BetaContextManagementResponse struct { AppliedEdits }
AppliedEdits []BetaContextManagementResponseAppliedEditUnion

List of context management edits that were applied.

One of the following:
type BetaClearToolUses20250919EditResponse struct { Type: "clear_tool_uses_20250919"; ClearedInputTokens; ClearedToolUses }
Type ClearToolUses20250919

The type of context management edit applied.

defaultclear_tool_uses_20250919
ClearedInputTokens int64

Number of input tokens cleared by this edit.

minimum0
ClearedToolUses int64

Number of tool uses that were cleared.

minimum0
type BetaClearThinking20251015EditResponse struct { Type: "clear_thinking_20251015"; ClearedInputTokens; ClearedThinkingTurns }
Type ClearThinking20251015

The type of context management edit applied.

defaultclear_thinking_20251015
ClearedInputTokens int64

Number of input tokens cleared by this edit.

minimum0
ClearedThinkingTurns int64

Number of thinking turns that were cleared.

minimum0
type BetaCountTokensContextManagementResponse struct { OriginalInputTokens }
OriginalInputTokens int64

The original token count before context management was applied

type BetaDiagnostics struct { CacheMissReason }

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

CacheMissReason BetaCacheMissReasonUnion

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:
type BetaDiagnosticsParam struct { PreviousMessageID }

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

PreviousMessageID string Optional

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
type BetaDirectCaller struct { Type: "direct" }

Tool invocation directly from the model.

Type Direct
type BetaDocumentBlock struct { Type: "document"; Citations; Source; Title }
type BetaEncryptedCodeExecutionResultBlock struct { Type: "encrypted_code_execution_result"; Content; EncryptedStdout; /* 2 more */ }

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

Type EncryptedCodeExecutionResult
defaultencrypted_code_execution_result
Type CodeExecutionOutput
defaultcode_execution_output
FileID string
EncryptedStdout string
ReturnCode int64
Stderr string
type BetaEncryptedCodeExecutionResultBlockParam struct { Type: "encrypted_code_execution_result"; Content; EncryptedStdout; /* 2 more */ }

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

Type EncryptedCodeExecutionResult
Type CodeExecutionOutput
FileID string
EncryptedStdout string
ReturnCode int64
Stderr string
type BetaFallbackBlock struct { Type: "fallback"; From; To; Trigger }

Marks the point in content where one model's output gives way to the next.

One block appears per hop where a preceding model actually ran this turn and declined. A turn where no preceding model ran and declined has no such boundary and carries no block — the signal for whether a fallback model served the response is the presence of a fallback_message entry in usage.iterations, not this block.

The block is treated like a server-tool content block for streaming: it arrives via the standard content_block_start / content_block_stop pair and carries no deltas.

type BetaFallbackBlockParam struct { Type: "fallback"; From; To; Trigger }

A fallback block echoed back from a prior response.

Accepted in messages[].content and not rendered into the prompt; not validated against the request's fallbacks chain or top-level model.

Echo the assistant turn back verbatim, including this block in its original position. The block marks the boundary between content produced before and after a fallback hop, and the server relies on that boundary to validate the turn: when thinking runs flank the boundary, omitting the block merges them into one span the server cannot validate (the request is rejected), and moving it into the middle of a single run is likewise rejected; between non-thinking blocks the block's placement has no validation effect.

Type Fallback

Identifies one hop of a fallback transition.

Model Model

The model that will complete your prompt.

See models for additional details and options.

One of the following:

Identifies one hop of a fallback transition.

Model Model

The model that will complete your prompt.

See models for additional details and options.

One of the following:
Trigger any Optional

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

type BetaFallbackCreditNotApplied struct { Type: "not_applied"; Reason; RemoveToRedeem }

No reprice was applied; reason says why.

type BetaFallbackCreditRedeemed struct { Type: "redeemed" }

The reprice was applied: the retry is billed as if the conversation had been on the retry model all along.

Type Redeemed
defaultredeemed
type BetaFallbackCreditTokenParam struct { Token; Mode }

Object form of fallback_credit_token: the token plus a redemption mode.

Requires anthropic-beta: fallback-credit-2026-07-01; without that header the field accepts the bare string only. The bare string and the mode-less object are equivalent (both select strict), so wrapping an existing token changes nothing by itself.

Token string

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

minLength1
maxLength2048
Mode BetaFallbackCreditTokenParamMode Optional

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

One of the following:
const BetaFallbackCreditTokenParamModeStrict BetaFallbackCreditTokenParamMode = "strict"
const BetaFallbackCreditTokenParamModeBestEffort BetaFallbackCreditTokenParamMode = "best_effort"
type BetaFallbackCreditUsage struct { Status }

Outcome of the fallback_credit_token presented on this request.

Status BetaFallbackCreditUsageStatusUnion

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

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

One of the following:
type BetaFallbackCreditRedeemed struct { Type: "redeemed" }

The reprice was applied: the retry is billed as if the conversation had been on the retry model all along.

Type Redeemed
defaultredeemed
type BetaFallbackCreditNotApplied struct { Type: "not_applied"; Reason; RemoveToRedeem }

No reprice was applied; reason says why.

type BetaFallbackInfo struct { Model }

Identifies one hop of a fallback transition.

Model Model

The model that will complete your prompt.

See models for additional details and options.

One of the following:
type BetaFallbackInfoParam struct { Model }

Identifies one hop of a fallback transition.

Model Model

The model that will complete your prompt.

See models for additional details and options.

One of the following:
type BetaFallbackMessageIterationUsage struct { Type: "fallback_message"; CacheCreation; CacheCreationInputTokens; /* 4 more */ }

Token usage for the fallback-model attempt of a server-side fallback request.

The terminal entry of a fallback-served turn: when a fallback hop's output is the returned message, the entry for the iteration that completed it carries this type in place of message. A declined hop and the serving hop's earlier tool-loop iterations produce message entries. Whether a fallback model served the response is signalled by the presence of this entry in usage.iterations.

Type FallbackMessage

Usage for the fallback-model attempt that served the response

defaultfallback_message
CacheCreation BetaCacheCreation

Breakdown of cached tokens by TTL

Ephemeral1hInputTokens int64

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

default0
minimum0
Ephemeral5mInputTokens int64

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

default0
minimum0
CacheCreationInputTokens int64

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

default0
minimum0
CacheReadInputTokens int64

The number of input tokens read from the cache.

default0
minimum0
InputTokens int64

The number of input tokens which were used.

minimum0
Model Model

The model that will complete your prompt.

See models for additional details and options.

One of the following:
OutputTokens int64

The number of output tokens which were used.

minimum0
type BetaFallbackParam struct { Model; MaxTokens; OutputConfig; /* 2 more */ }

One entry in the fallbacks chain on a /v1/messages request.

model is required. The override fields (max_tokens, thinking, output_config, and speed) set the corresponding parameter for this attempt only and are validated as if the request were made to model. Any other key is rejected at parse time.

type BetaFallbackRefusalTrigger struct { Type: "refusal"; Category }

The from model declined for policy reasons.

Type Refusal
defaultrefusal
Category BetaFallbackRefusalTriggerCategory

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

One of the following:
const BetaFallbackRefusalTriggerCategoryCyber BetaFallbackRefusalTriggerCategory = "cyber"

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

const BetaFallbackRefusalTriggerCategoryBio BetaFallbackRefusalTriggerCategory = "bio"

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

const BetaFallbackRefusalTriggerCategoryFrontierLLM BetaFallbackRefusalTriggerCategory = "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.

const BetaFallbackRefusalTriggerCategoryReasoningExtraction BetaFallbackRefusalTriggerCategory = "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.

const BetaFallbackRefusalTriggerCategoryGeneralHarms BetaFallbackRefusalTriggerCategory = "general_harms"

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

type BetaFallbacksParamUnion interface{…}

Opt-in server-side retry on one or more substitute models when the requested model declines for policy reasons. Tried in order: if the first entry also declines, the second is tried, and so on. Some models don't support fallbacks; on those models, a list of fallback models returns a 400 error. See Server-side fallback. The string "default" requests the requested model's server-defined default fallback configuration. On a model that doesn't support fallbacks, the request runs on the requested model alone, so a declined request stays declined.

One of the following:
type BetaFileDocumentSourceParam struct { Type: "file"; FileID }
Type File
FileID string
type BetaFileImageSourceParam struct { Type: "file"; FileID }
Type File
FileID string
type BetaImageBlockParam struct { Type: "image"; Source; CacheControl; Transformations }
type BetaImageTransformationsParam struct { OversizedImage }

Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.

OversizedImage BetaImageTransformationsParamOversizedImage Optional

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:
const BetaImageTransformationsParamOversizedImageDownsize BetaImageTransformationsParamOversizedImage = "downsize"
const BetaImageTransformationsParamOversizedImageError BetaImageTransformationsParamOversizedImage = "error"
type BetaInputJSONDelta struct { Type: "input_json_delta"; PartialJSON }
Type InputJSONDelta
defaultinput_json_delta
PartialJSON string
type BetaInputTokensClearAtLeastParam struct { Type: "input_tokens"; Value }
Type InputTokens
Value int64
minimum0
type BetaInputTokensTriggerParam struct { Type: "input_tokens"; Value }
Type InputTokens
Value int64
minimum1
type BetaInputTransformationUnion interface{…}

One entry of input_transformations: either a change the API made to the request's input before showing it to the model, or a block that failed a binding check and was still shown to the model unchanged. The type field says which.

One of the following:
type BetaIterationsUsage []BetaIterationsUsageItemUnion

Per-iteration token usage breakdown.

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

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

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

One of the following:
type BetaJSONOutputFormatParam struct { Type: "json_schema"; Schema }
Type JSONSchema
Schema map[string, any]

The JSON schema of the format

type BetaMCPTool struct { InputSchema; Name; Description }

A tool as an MCP server lists it: its name on that server, its description, and its input schema.

InputSchema map[string, any]
Name string
Description string Optional
type BetaMCPToolConfig struct { DeferLoading; Enabled }

Configuration for a specific tool in an MCP toolset.

DeferLoading bool Optional
Enabled bool Optional
type BetaMCPToolDefaultConfig struct { DeferLoading; Enabled }

Default configuration for tools in an MCP toolset.

DeferLoading bool Optional
Enabled bool Optional
type BetaMCPToolListingBlock struct { Type: "mcp_tool_listing"; MCPServerName; Tools }

The tool listing the server fetched from an MCP server while producing this response. Send the assistant message back unchanged, this block included, so later requests use this listing instead of asking the MCP server again.

Type MCPToolListing
defaultmcp_tool_listing
MCPServerName string
Tools []BetaMCPTool
InputSchema map[string, any]
Name string
Description string Optional
type BetaMCPToolListingBlockParam struct { Type: "mcp_tool_listing"; MCPServerName; Tools }

The tool listing an MCP server returned while an earlier response was produced, as that response carried it. Send the assistant message back unchanged, this block included, and the server uses this listing for the matching mcp_toolset instead of asking the MCP server again.

Type MCPToolListing
MCPServerName string

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

minLength1
maxLength255
Tools []BetaMCPToolParam

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

InputSchema map[string, any]

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

Name string

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

minLength1
Description string Optional

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

type BetaMCPToolParamResp struct { InputSchema; Name; Description }

A tool as an MCP server lists it: its name on that server, its description, and its input schema.

InputSchema map[string, any]

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

Name string

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

minLength1
Description string Optional

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

type BetaMCPToolResultBlock struct { Type: "mcp_tool_result"; Content; IsError; ToolUseID }
type BetaMCPToolUseBlock struct { Type: "mcp_tool_use"; ID; Input; /* 2 more */ }
Type MCPToolUse
defaultmcp_tool_use
ID string
pattern^[a-zA-Z0-9_-]+$
Input map[string, any]
Name string

The name of the MCP tool

ServerName string

The name of the MCP server

type BetaMCPToolUseBlockParam struct { Type: "mcp_tool_use"; ID; Input; /* 3 more */ }
Type MCPToolUse
ID string
pattern^[a-zA-Z0-9_-]+$
Input map[string, any]
Name string
ServerName string

The name of the MCP server

CacheControl BetaCacheControlEphemeralParam Optional

Create a cache control breakpoint at this content block.

Type Ephemeral
TTL BetaCacheControlEphemeralTTL Optional

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:
const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
type BetaMCPToolset struct { Type: "mcp_toolset"; MCPServerName; CacheControl; /* 3 more */ }

Configuration for a group of tools from an MCP server.

Allows configuring enabled status and defer_loading for all tools from an MCP server, with optional per-tool overrides.

type BetaMemoryTool20250818 struct { Type: "memory_20250818"; Name; AllowedCallers; /* 4 more */ }
type BetaMemoryTool20250818CommandUnion interface{…}
One of the following:
type BetaMemoryTool20250818CreateCommand struct { Command; FileText; Path }
Command Create

Command type identifier

defaultcreate
FileText string

Content to write to the file

Path string

Path where the file should be created

type BetaMemoryTool20250818DeleteCommand struct { Command; Path }
Command Delete

Command type identifier

defaultdelete
Path string

Path to the file or directory to delete

type BetaMemoryTool20250818InsertCommand struct { Command; InsertLine; InsertText; Path }
Command Insert

Command type identifier

defaultinsert
InsertLine int64

Line number where text should be inserted

minimum1
InsertText string

Text to insert at the specified line

Path string

Path to the file where text should be inserted

type BetaMemoryTool20250818RenameCommand struct { Command; NewPath; OldPath }
Command Rename

Command type identifier

defaultrename
NewPath string

New path for the file or directory

OldPath string

Current path of the file or directory

type BetaMemoryTool20250818StrReplaceCommand struct { Command; NewStr; OldStr; Path }
Command StrReplace

Command type identifier

defaultstr_replace
NewStr string

Text to replace with

OldStr string

Text to search for and replace

Path string

Path to the file where text should be replaced

type BetaMemoryTool20250818ViewCommand struct { Command; Path; ViewRange }
Command View

Command type identifier

defaultview
Path string

Path to directory or file to view

ViewRange []int64 Optional

Optional line range for viewing specific lines

minItems2
maxItems2
type BetaMessage struct { Type: "message"; ID; Container; /* 10 more */ }
type BetaMessageDeltaUsage struct { CacheCreationInputTokens; CacheReadInputTokens; FallbackCredit; /* 5 more */ }
type BetaMessageIterationUsage struct { Type: "message"; CacheCreation; CacheCreationInputTokens; /* 4 more */ }

Token usage for a sampling iteration.

Type Message

Usage for a sampling iteration

defaultmessage
CacheCreation BetaCacheCreation

Breakdown of cached tokens by TTL

Ephemeral1hInputTokens int64

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

default0
minimum0
Ephemeral5mInputTokens int64

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

default0
minimum0
CacheCreationInputTokens int64

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

default0
minimum0
CacheReadInputTokens int64

The number of input tokens read from the cache.

default0
minimum0
InputTokens int64

The number of input tokens which were used.

minimum0
Model Model

The model that will complete your prompt.

See models for additional details and options.

One of the following:
OutputTokens int64

The number of output tokens which were used.

minimum0
type BetaMessageParam struct { Content; Role; ClearAt; OutputConfig }
type BetaMessageTokensCount struct { ContextManagement; InputTokens }

Information about context management applied to the message.

OriginalInputTokens int64

The original token count before context management was applied

InputTokens int64

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

type BetaMetadataParam struct { UserID }
UserID string Optional

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
type BetaOutputConfigParam struct { Effort; Format; TaskBudget }
type BetaOutputTokensDetails struct { ThinkingTokens }
ThinkingTokens int64

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.

default0
minimum0
type BetaPlainTextSource struct { Type: "text"; Data; MediaType }
Type Text
Data string
MediaType TextPlain
type BetaRawContentBlockDeltaUnion interface{…}
One of the following:
type BetaRawContentBlockDeltaEvent struct { Type: "content_block_delta"; Delta; Index }
Type ContentBlockDelta
defaultcontent_block_delta
One of the following:
Index int64
type BetaRawContentBlockStartEvent struct { Type: "content_block_start"; ContentBlock; Index }
type BetaRawContentBlockStopEvent struct { Type: "content_block_stop"; Index }
Type ContentBlockStop
defaultcontent_block_stop
Index int64
type BetaRawMessageDeltaEvent struct { Type: "message_delta"; ContextManagement; Delta; /* 2 more */ }
type BetaRawMessageStartEvent struct { Type: "message_start"; Message }
Type MessageStart
defaultmessage_start
Message BetaMessage
type BetaRawMessageStopEvent struct { Type: "message_stop" }
Type MessageStop
defaultmessage_stop
type BetaRawMessageStreamEventUnion interface{…}
One of the following:
type BetaRedactedThinkingBlock struct { Type: "redacted_thinking"; Data }
Type RedactedThinking
defaultredacted_thinking
Data string

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

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

See extended thinking for details.

type BetaRedactedThinkingBlockParam struct { Type: "redacted_thinking"; Data }
Type RedactedThinking
Data string

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

type BetaRefusalStopDetails struct { Type: "refusal"; Category; Explanation; /* 3 more */ }

Structured information about a refusal.

type BetaRequestDocumentBlockParam struct { Type: "document"; Source; CacheControl; /* 3 more */ }
type BetaRequestMCPServerToolConfigurationParam struct { AllowedTools; Enabled }
AllowedTools []string Optional
Enabled bool Optional
type BetaRequestMCPServerURLDefinitionParam struct { Type: "url"; Name; URL; /* 2 more */ }
Type URL
Name string
URL string
AuthorizationToken string Optional
ToolConfiguration BetaRequestMCPServerToolConfigurationParam Optional
AllowedTools []string Optional
Enabled bool Optional
type BetaRequestMCPToolResultBlockParam struct { Type: "mcp_tool_result"; ToolUseID; CacheControl; /* 2 more */ }
type BetaRequestToolAdditionBlockParam struct { Type: "tool_addition"; Tool; CacheControl }

Mid-conversation directive to make a tool available.

tool is a reference to a tool (or MCP toolset) declared in the request's tools. Under the inline-tools-2026-09-15 beta it may instead be a reference to a tool defined earlier in messages, or a tool_definition object that carries an inline tool definition in definition (the same object a tools entry holds). An mcp_toolset definition also requires the mcp-client-2026-09-15 beta. The tool is offered to the model from this point in the conversation onward.

type BetaRequestToolRemovalBlockParam struct { Type: "tool_removal"; Tool; CacheControl }

Mid-conversation directive to withdraw a tool.

tool references a tool (or MCP toolset) by name: one declared in the request's tools or defined earlier in messages. It is no longer offered to the model from this point in the conversation onward.

type BetaResponseTool struct { Type: "custom"; InputSchema; Name; /* 6 more */ }

A custom tool definition, as sent.

type BetaResponseToolAdditionBlock struct { Type: "tool_addition"; Tool }

An entry of a compaction block's tool_changes: a tool the compacted range made available, as a reference to a tools entry or MCP toolset, or as the tool definition in effect at the end of the range, by value. Send it back unchanged.

type BetaResponseToolChangeMCPToolReference struct { Type: "mcp_tool_reference"; Name; ServerName }

Reference to a single MCP tool, by its server and its name on that server, as a compaction block's tool_changes entry reports it. Send it back unchanged with the block.

Type MCPToolReference
defaultmcp_tool_reference
Name string
ServerName string
type BetaResponseToolChangeMCPToolsetReference struct { Type: "mcp_toolset_reference"; ServerName }

Reference to every tool in the named MCP server's toolset, as a compaction block's tool_changes entry reports it. Send it back unchanged with the block.

Type MCPToolsetReference
defaultmcp_toolset_reference
ServerName string
type BetaResponseToolChangeToolReference struct { Type: "tool_reference"; Name }

Reference to a single tool, by the name the model uses to call it, as a compaction block's tool_changes entry reports it: a tool declared in tools or defined by an earlier tool_addition block. Send it back unchanged with the block.

Type ToolReference
defaulttool_reference
Name string
type BetaResponseToolInputSchema struct { Type: "object"; Properties; Required }

JSON schema for this tool's input.

This defines the shape of the input that your tool accepts and that the model will produce.

Type Object
Properties map[string, any] Optional
Required []string Optional
type BetaResponseToolRemovalBlock struct { Type: "tool_removal"; Tool }

An entry of a compaction block's tool_changes: a tool of the request's tools (or an MCP tool or toolset) that the compacted range withdrew. Send it back unchanged.

type BetaResponseToolUnion interface{…}
One of the following:
type BetaSearchResultBlockParam struct { Type: "search_result"; Content; Source; /* 3 more */ }
type BetaServerToolCaller struct { Type: "code_execution_20250825"; ToolID }

Tool invocation generated by a server-side tool.

Type CodeExecution20250825
ToolID string
pattern^srvtoolu_[a-zA-Z0-9_]+$
type BetaServerToolCaller20260120 struct { Type: "code_execution_20260120"; ToolID }
Type CodeExecution20260120
ToolID string
pattern^srvtoolu_[a-zA-Z0-9_]+$
type BetaServerToolUsage struct { WebFetchRequests; WebSearchRequests }
WebFetchRequests int64

The number of web fetch tool requests.

default0
minimum0
WebSearchRequests int64

The number of web search tool requests.

default0
minimum0
type BetaServerToolUseBlock struct { Type: "server_tool_use"; ID; Input; /* 2 more */ }
type BetaServerToolUseBlockParam struct { Type: "server_tool_use"; ID; Input; /* 3 more */ }
type BetaSignatureDelta struct { Type: "signature_delta"; Signature }
Type SignatureDelta
defaultsignature_delta
Signature string

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

type BetaSkillParams struct { Type; SkillID; Version }

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

Type BetaSkillParamsType

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

One of the following:
const BetaSkillParamsTypeAnthropic BetaSkillParamsType = "anthropic"
const BetaSkillParamsTypeCustom BetaSkillParamsType = "custom"
SkillID string

Skill ID

minLength1
maxLength64
Version string Optional

Skill version or 'latest' for most recent version

minLength1
maxLength64
type BetaStopReason string
One of the following:
const BetaStopReasonEndTurn BetaStopReason = "end_turn"
const BetaStopReasonMaxTokens BetaStopReason = "max_tokens"
const BetaStopReasonStopSequence BetaStopReason = "stop_sequence"
const BetaStopReasonToolUse BetaStopReason = "tool_use"
const BetaStopReasonPauseTurn BetaStopReason = "pause_turn"
const BetaStopReasonCompaction BetaStopReason = "compaction"
const BetaStopReasonRefusal BetaStopReason = "refusal"
const BetaStopReasonModelContextWindowExceeded BetaStopReason = "model_context_window_exceeded"
type BetaSummarizeCompaction struct { Type: "summarize"; Instructions }

Compact the whole conversation and return a signed compaction block, alone, that a later request sends back first in messages, in place of the messages it summarizes. There is no trigger and no pause flag: sending the parameter compacts, and nothing is sampled after the block.

The summarization prompt is the server's own unless instructions are given, which then replace it for this request; a value that is empty or only whitespace counts as absent.

Type Summarize
Instructions string Optional

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

maxLength16384
type BetaSystemMessageOutputConfigParam struct { Effort }

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

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

Effort BetaSystemMessageOutputConfigEffort Optional

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:
const BetaSystemMessageOutputConfigEffortLow BetaSystemMessageOutputConfigEffort = "low"
const BetaSystemMessageOutputConfigEffortMedium BetaSystemMessageOutputConfigEffort = "medium"
const BetaSystemMessageOutputConfigEffortHigh BetaSystemMessageOutputConfigEffort = "high"
const BetaSystemMessageOutputConfigEffortXhigh BetaSystemMessageOutputConfigEffort = "xhigh"
const BetaSystemMessageOutputConfigEffortMax BetaSystemMessageOutputConfigEffort = "max"
type BetaTextBlock struct { Type: "text"; Citations; Text }
type BetaTextBlockParam struct { Type: "text"; Text; CacheControl; Citations }
type BetaTextCitationUnion interface{…}
One of the following:
type BetaTextCitationParamUnion interface{…}
One of the following:
type BetaTextDelta struct { Type: "text_delta"; Text }
Type TextDelta
defaulttext_delta
Text string
type BetaTextEditorCodeExecutionCreateResultBlock struct { Type: "text_editor_code_execution_create_result"; IsFileUpdate }
Type TextEditorCodeExecutionCreateResult
defaulttext_editor_code_execution_create_result
IsFileUpdate bool
type BetaTextEditorCodeExecutionCreateResultBlockParam struct { Type: "text_editor_code_execution_create_result"; IsFileUpdate }
Type TextEditorCodeExecutionCreateResult
IsFileUpdate bool
type BetaTextEditorCodeExecutionStrReplaceResultBlock struct { Type: "text_editor_code_execution_str_replace_result"; Lines; NewLines; /* 3 more */ }
Type TextEditorCodeExecutionStrReplaceResult
defaulttext_editor_code_execution_str_replace_result
Lines []string
NewLines int64
NewStart int64
OldLines int64
OldStart int64
type BetaTextEditorCodeExecutionStrReplaceResultBlockParam struct { Type: "text_editor_code_execution_str_replace_result"; Lines; NewLines; /* 3 more */ }
Type TextEditorCodeExecutionStrReplaceResult
Lines []string Optional
NewLines int64 Optional
NewStart int64 Optional
OldLines int64 Optional
OldStart int64 Optional
type BetaTextEditorCodeExecutionToolResultBlock struct { Type: "text_editor_code_execution_tool_result"; Content; ToolUseID }
type BetaTextEditorCodeExecutionToolResultBlockParam struct { Type: "text_editor_code_execution_tool_result"; Content; ToolUseID; CacheControl }
type BetaTextEditorCodeExecutionToolResultError struct { Type: "text_editor_code_execution_tool_result_error"; ErrorCode; ErrorMessage }
Type TextEditorCodeExecutionToolResultError
defaulttext_editor_code_execution_tool_result_error
ErrorCode BetaTextEditorCodeExecutionToolResultErrorErrorCode
One of the following:
const BetaTextEditorCodeExecutionToolResultErrorErrorCodeInvalidToolInput BetaTextEditorCodeExecutionToolResultErrorErrorCode = "invalid_tool_input"
const BetaTextEditorCodeExecutionToolResultErrorErrorCodeUnavailable BetaTextEditorCodeExecutionToolResultErrorErrorCode = "unavailable"
const BetaTextEditorCodeExecutionToolResultErrorErrorCodeTooManyRequests BetaTextEditorCodeExecutionToolResultErrorErrorCode = "too_many_requests"
const BetaTextEditorCodeExecutionToolResultErrorErrorCodeExecutionTimeExceeded BetaTextEditorCodeExecutionToolResultErrorErrorCode = "execution_time_exceeded"
const BetaTextEditorCodeExecutionToolResultErrorErrorCodeFileNotFound BetaTextEditorCodeExecutionToolResultErrorErrorCode = "file_not_found"
ErrorMessage string
type BetaTextEditorCodeExecutionToolResultErrorParam struct { Type: "text_editor_code_execution_tool_result_error"; ErrorCode; ErrorMessage }
Type TextEditorCodeExecutionToolResultError
ErrorCode BetaTextEditorCodeExecutionToolResultErrorParamErrorCode
One of the following:
const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeInvalidToolInput BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input"
const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeUnavailable BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "unavailable"
const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeTooManyRequests BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "too_many_requests"
const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded"
const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeFileNotFound BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "file_not_found"
ErrorMessage string Optional
type BetaTextEditorCodeExecutionViewResultBlock struct { Type: "text_editor_code_execution_view_result"; Content; FileType; /* 3 more */ }
Type TextEditorCodeExecutionViewResult
defaulttext_editor_code_execution_view_result
Content string
FileType BetaTextEditorCodeExecutionViewResultBlockFileType
One of the following:
const BetaTextEditorCodeExecutionViewResultBlockFileTypeText BetaTextEditorCodeExecutionViewResultBlockFileType = "text"
const BetaTextEditorCodeExecutionViewResultBlockFileTypeImage BetaTextEditorCodeExecutionViewResultBlockFileType = "image"
const BetaTextEditorCodeExecutionViewResultBlockFileTypePDF BetaTextEditorCodeExecutionViewResultBlockFileType = "pdf"
NumLines int64
StartLine int64
TotalLines int64
type BetaTextEditorCodeExecutionViewResultBlockParam struct { Type: "text_editor_code_execution_view_result"; Content; FileType; /* 3 more */ }
Type TextEditorCodeExecutionViewResult
Content string
FileType BetaTextEditorCodeExecutionViewResultBlockParamFileType
One of the following:
const BetaTextEditorCodeExecutionViewResultBlockParamFileTypeText BetaTextEditorCodeExecutionViewResultBlockParamFileType = "text"
const BetaTextEditorCodeExecutionViewResultBlockParamFileTypeImage BetaTextEditorCodeExecutionViewResultBlockParamFileType = "image"
const BetaTextEditorCodeExecutionViewResultBlockParamFileTypePDF BetaTextEditorCodeExecutionViewResultBlockParamFileType = "pdf"
NumLines int64 Optional
StartLine int64 Optional
TotalLines int64 Optional
type BetaThinkingBlock struct { Type: "thinking"; Signature; Thinking }
Type Thinking
defaultthinking
Signature string

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.

Thinking string

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

type BetaThinkingBlockBindingParam struct { PrefixMismatchBehavior }

Controls for block binding: what happens when a thinking block this request sends back fails the conversation check. Every field is optional; an empty object means every default.

PrefixMismatchBehavior BetaThinkingPrefixMismatchBehavior Optional

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

One of the following:
const BetaThinkingPrefixMismatchBehaviorError BetaThinkingPrefixMismatchBehavior = "error"
const BetaThinkingPrefixMismatchBehaviorDropBlock BetaThinkingPrefixMismatchBehavior = "drop_block"
type BetaThinkingBlockParam struct { Type: "thinking"; Signature; Thinking }
Type Thinking
Signature string

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.

Thinking string

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

type BetaThinkingConfigAdaptiveParam struct { Type: "adaptive"; BlockBinding; Display }
Type Adaptive
BlockBinding BetaThinkingBlockBindingParam Optional

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

PrefixMismatchBehavior BetaThinkingPrefixMismatchBehavior Optional

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

One of the following:
const BetaThinkingPrefixMismatchBehaviorError BetaThinkingPrefixMismatchBehavior = "error"
const BetaThinkingPrefixMismatchBehaviorDropBlock BetaThinkingPrefixMismatchBehavior = "drop_block"
Display BetaThinkingConfigAdaptiveDisplay Optional

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:
const BetaThinkingConfigAdaptiveDisplaySummarized BetaThinkingConfigAdaptiveDisplay = "summarized"
const BetaThinkingConfigAdaptiveDisplayOmitted BetaThinkingConfigAdaptiveDisplay = "omitted"
const BetaThinkingConfigAdaptiveDisplayUpdates BetaThinkingConfigAdaptiveDisplay = "updates"
type BetaThinkingConfigBetweenToolsParam struct { Type: "between_tools" }
Type BetweenTools
type BetaThinkingConfigDisabledParam struct { Type: "disabled" }
Type Disabled
type BetaThinkingConfigEnabledParam struct { Type: "enabled"; BudgetTokens; BlockBinding; Display }
type BetaThinkingConfigParamUnion interface{…}

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.

One of the following:
type BetaThinkingDelta struct { Type: "thinking_delta"; EstimatedTokens; Thinking }
Type ThinkingDelta
defaultthinking_delta
EstimatedTokens int64

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

Thinking string

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

type BetaThinkingDroppedInputTransformation struct { Type: "thinking_dropped"; Path; Reason }
Type ThinkingDropped

Always thinking_dropped for this entry type.

defaultthinking_dropped
Path string

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

Reason BetaThinkingDroppedInputTransformationReason

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

One of the following:
const BetaThinkingDroppedInputTransformationReasonModelBindingMismatch BetaThinkingDroppedInputTransformationReason = "model_binding_mismatch"
const BetaThinkingDroppedInputTransformationReasonPrefixBindingMismatch BetaThinkingDroppedInputTransformationReason = "prefix_binding_mismatch"
const BetaThinkingDroppedInputTransformationReasonOrganizationBindingMismatch BetaThinkingDroppedInputTransformationReason = "organization_binding_mismatch"
const BetaThinkingDroppedInputTransformationReasonEndUserBindingMismatch BetaThinkingDroppedInputTransformationReason = "end_user_binding_mismatch"
type BetaThinkingMismatchAllowedInputTransformation struct { Type: "thinking_mismatch_allowed"; Path; Reason }
Type ThinkingMismatchAllowed

Always thinking_mismatch_allowed for this entry type.

defaultthinking_mismatch_allowed
Path string

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

Reason BetaThinkingMismatchAllowedInputTransformationReason

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

One of the following:
const BetaThinkingMismatchAllowedInputTransformationReasonModelBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "model_binding_mismatch"
const BetaThinkingMismatchAllowedInputTransformationReasonPrefixBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "prefix_binding_mismatch"
const BetaThinkingMismatchAllowedInputTransformationReasonOrganizationBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "organization_binding_mismatch"
const BetaThinkingMismatchAllowedInputTransformationReasonEndUserBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "end_user_binding_mismatch"
type BetaThinkingPrefixMismatchBehavior string

What happens when a thinking block in messages fails the conversation check: it was created in a different conversation, or the messages before it have changed since. "error" (the default) fails the request with a 400 error. "drop_block" removes the failing blocks and the request proceeds; the model no longer sees the dropped reasoning.

One of the following:
const BetaThinkingPrefixMismatchBehaviorError BetaThinkingPrefixMismatchBehavior = "error"
const BetaThinkingPrefixMismatchBehaviorDropBlock BetaThinkingPrefixMismatchBehavior = "drop_block"
type BetaThinkingTurnsParam struct { Type: "thinking_turns"; Value }
Type ThinkingTurns
Value int64
minimum1
type BetaTokenTaskBudgetParam struct { Type: "tokens"; Total; Remaining }

User-configurable total token budget across contexts.

Type Tokens

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

Total int64

Total token budget across all contexts in the session.

minimum1024
Remaining int64 Optional

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

minimum0
type BetaToolParam struct { Type: "custom"; InputSchema; Name; /* 7 more */ }
type BetaToolBash20241022 struct { Type: "bash_20241022"; Name; AllowedCallers; /* 4 more */ }
type BetaToolBash20250124 struct { Type: "bash_20250124"; Name; AllowedCallers; /* 4 more */ }
type BetaToolChangeMCPToolReferenceParam struct { Type: "mcp_tool_reference"; Name; ServerName }

Reference to a single MCP tool by its server and remote name; the same server_name/name pair mcp_tool_use carries.

Type MCPToolReference
Name string
ServerName string
type BetaToolChangeMCPToolsetReferenceParam struct { Type: "mcp_toolset_reference"; ServerName }

Reference to every tool in the named MCP server's toolset.

Type MCPToolsetReference
ServerName string
type BetaToolChangeToolDefinition struct { Type: "tool_definition"; Definition }

A tool defined by value, as a compaction block's tool_changes entry reports it: definition is the tool's definition as it was sent, in the form of a tools entry, without cache_control. Send it back unchanged with the block.

Type ToolDefinition
defaulttool_definition
Definition BetaResponseToolUnion
One of the following:
type BetaToolChangeToolDefinitionParam struct { Type: "tool_definition"; Definition }

A tool defined by value: definition is a tools entry (any kind tools accepts, an MCP toolset included). An mcp_toolset given here also requires the mcp-client-2026-09-15 beta.

Type ToolDefinition
Definition BetaToolUnionParam
One of the following:
type BetaToolChangeToolReferenceParam struct { Type: "tool_reference"; Name }

Reference to a single tool, by the name the model uses to call it: a tool declared in tools or defined by an earlier tool_addition block. Does not accept the composed {server}_{name} form the server assigns to MCP-resolved tools; use mcp_tool_reference or mcp_toolset_reference for those.

Type ToolReference
Name string
pattern^[a-zA-Z0-9_-]{1,128}$
type BetaToolChoiceUnionParam interface{…}

How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.

One of the following:
type BetaToolChoiceAnyParam struct { Type: "any"; DisableParallelToolUse }

The model will use any available tools.

Type Any
DisableParallelToolUse bool Optional

Whether to disable parallel tool use.

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

type BetaToolChoiceAutoParam struct { Type: "auto"; DisableParallelToolUse }

The model will automatically decide whether to use tools.

Type Auto
DisableParallelToolUse bool Optional

Whether to disable parallel tool use.

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

type BetaToolChoiceNoneParam struct { Type: "none" }

The model will not be allowed to use tools.

Type None
type BetaToolChoiceToolParam struct { Type: "tool"; Name; DisableParallelToolUse }

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

Type Tool
Name string

The name of the tool to use.

DisableParallelToolUse bool Optional

Whether to disable parallel tool use.

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

type BetaToolComputerUse20241022 struct { Type: "computer_20241022"; DisplayHeightPx; DisplayWidthPx; /* 7 more */ }
type BetaToolComputerUse20250124 struct { Type: "computer_20250124"; DisplayHeightPx; DisplayWidthPx; /* 7 more */ }
type BetaToolComputerUse20251124 struct { Type: "computer_20251124"; DisplayHeightPx; DisplayWidthPx; /* 8 more */ }
type BetaToolReferenceBlock struct { Type: "tool_reference"; ToolName }
Type ToolReference
defaulttool_reference
ToolName string
minLength1
maxLength256
pattern^[a-zA-Z0-9_-]{1,256}$
type BetaToolReferenceBlockParam struct { Type: "tool_reference"; ToolName; CacheControl }

Tool reference block that can be included in tool_result content.

Type ToolReference
ToolName string
minLength1
maxLength256
pattern^[a-zA-Z0-9_-]{1,256}$
CacheControl BetaCacheControlEphemeralParam Optional

Create a cache control breakpoint at this content block.

Type Ephemeral
TTL BetaCacheControlEphemeralTTL Optional

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:
const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
type BetaToolResultBlockParam struct { Type: "tool_result"; ToolUseID; CacheControl; /* 3 more */ }
type BetaToolSearchToolBm25_20251119 struct { Type; Name; AllowedCallers; /* 3 more */ }
type BetaToolSearchToolRegex20251119 struct { Type; Name; AllowedCallers; /* 3 more */ }
type BetaToolSearchToolResultBlock struct { Type: "tool_search_tool_result"; Content; ToolUseID }
type BetaToolSearchToolResultBlockParam struct { Type: "tool_search_tool_result"; Content; ToolUseID; CacheControl }
type BetaToolSearchToolResultError struct { Type: "tool_search_tool_result_error"; ErrorCode; ErrorMessage }
Type ToolSearchToolResultError
defaulttool_search_tool_result_error
ErrorCode BetaToolSearchToolResultErrorErrorCode
One of the following:
const BetaToolSearchToolResultErrorErrorCodeInvalidToolInput BetaToolSearchToolResultErrorErrorCode = "invalid_tool_input"
const BetaToolSearchToolResultErrorErrorCodeUnavailable BetaToolSearchToolResultErrorErrorCode = "unavailable"
const BetaToolSearchToolResultErrorErrorCodeTooManyRequests BetaToolSearchToolResultErrorErrorCode = "too_many_requests"
const BetaToolSearchToolResultErrorErrorCodeExecutionTimeExceeded BetaToolSearchToolResultErrorErrorCode = "execution_time_exceeded"
ErrorMessage string
type BetaToolSearchToolResultErrorParam struct { Type: "tool_search_tool_result_error"; ErrorCode; ErrorMessage }
Type ToolSearchToolResultError
ErrorCode BetaToolSearchToolResultErrorParamErrorCode
One of the following:
const BetaToolSearchToolResultErrorParamErrorCodeInvalidToolInput BetaToolSearchToolResultErrorParamErrorCode = "invalid_tool_input"
const BetaToolSearchToolResultErrorParamErrorCodeUnavailable BetaToolSearchToolResultErrorParamErrorCode = "unavailable"
const BetaToolSearchToolResultErrorParamErrorCodeTooManyRequests BetaToolSearchToolResultErrorParamErrorCode = "too_many_requests"
const BetaToolSearchToolResultErrorParamErrorCodeExecutionTimeExceeded BetaToolSearchToolResultErrorParamErrorCode = "execution_time_exceeded"
ErrorMessage string Optional
type BetaToolSearchToolSearchResultBlock struct { Type: "tool_search_tool_search_result"; ToolReferences }
Type ToolSearchToolSearchResult
defaulttool_search_tool_search_result
ToolReferences []BetaToolReferenceBlock
Type ToolReference
defaulttool_reference
ToolName string
minLength1
maxLength256
pattern^[a-zA-Z0-9_-]{1,256}$
type BetaToolSearchToolSearchResultBlockParam struct { Type: "tool_search_tool_search_result"; ToolReferences }
Type ToolSearchToolSearchResult
ToolReferences []BetaToolReferenceBlockParam
Type ToolReference
ToolName string
minLength1
maxLength256
pattern^[a-zA-Z0-9_-]{1,256}$
CacheControl BetaCacheControlEphemeralParam Optional

Create a cache control breakpoint at this content block.

Type Ephemeral
TTL BetaCacheControlEphemeralTTL Optional

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:
const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
type BetaToolTextEditor20241022 struct { Type: "text_editor_20241022"; Name; AllowedCallers; /* 4 more */ }
type BetaToolTextEditor20250124 struct { Type: "text_editor_20250124"; Name; AllowedCallers; /* 4 more */ }
type BetaToolTextEditor20250429 struct { Type: "text_editor_20250429"; Name; AllowedCallers; /* 4 more */ }
type BetaToolTextEditor20250728 struct { Type: "text_editor_20250728"; Name; AllowedCallers; /* 5 more */ }
type BetaToolUnionParam interface{…}
One of the following:
type BetaToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaToolUseBlockParam struct { Type: "tool_use"; ID; Input; /* 4 more */ }
type BetaToolUseCallerUnion interface{…}

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

One of the following:
type BetaDirectCaller struct { Type: "direct" }

Tool invocation directly from the model.

Type Direct
type BetaServerToolCaller struct { Type: "code_execution_20250825"; ToolID }

Tool invocation generated by a server-side tool.

Type CodeExecution20250825
ToolID string
pattern^srvtoolu_[a-zA-Z0-9_]+$
type BetaServerToolCaller20260120 struct { Type: "code_execution_20260120"; ToolID }
Type CodeExecution20260120
ToolID string
pattern^srvtoolu_[a-zA-Z0-9_]+$
type BetaToolUsesKeepParam struct { Type: "tool_uses"; Value }
Type ToolUses
Value int64
minimum0
type BetaToolUsesTriggerParam struct { Type: "tool_uses"; Value }
Type ToolUses
Value int64
minimum1
type BetaToolsetToolUseBlockUnion interface{…}
One of the following:
type BetaBrowserToolUseBlockUnion interface{…}
One of the following:
type BetaComputerToolUseBlockUnion interface{…}
One of the following:
type BetaToolUseBlock struct { Type: "tool_use"; ID; Input; /* 3 more */ }
type BetaURLImageSourceParam struct { Type: "url"; URL }
Type URL
URL string
type BetaURLPDFSourceParam struct { Type: "url"; URL }
Type URL
URL string
type BetaUsage struct { CacheCreation; CacheCreationInputTokens; CacheReadInputTokens; /* 9 more */ }
type BetaUserLocation struct { Type: "approximate"; City; Country; /* 2 more */ }
Type Approximate
City string Optional

The city of the user.

minLength1
maxLength255
Country string Optional

The two letter ISO country code of the user.

minLength2
maxLength2
Region string Optional

The region of the user.

minLength1
maxLength255
Timezone string Optional

The IANA timezone of the user.

minLength1
maxLength255
type BetaWebFetchBlock struct { Type: "web_fetch_result"; Content; RetrievedAt; URL }
type BetaWebFetchBlockParam struct { Type: "web_fetch_result"; Content; URL; RetrievedAt }
Type WebFetchResult
URL string

Fetched content URL

RetrievedAt string Optional

ISO 8601 timestamp when the content was retrieved

type BetaWebFetchTool20250910 struct { Type: "web_fetch_20250910"; Name; AllowedCallers; /* 9 more */ }
type BetaWebFetchTool20260209 struct { Type: "web_fetch_20260209"; Name; AllowedCallers; /* 9 more */ }
type BetaWebFetchTool20260309 struct { Type: "web_fetch_20260309"; Name; AllowedCallers; /* 10 more */ }

Web fetch tool with use_cache parameter for bypassing cached content.

type BetaWebFetchTool20260318 struct { Type: "web_fetch_20260318"; Name; AllowedCallers; /* 11 more */ }
type BetaWebFetchToolResultBlock struct { Type: "web_fetch_tool_result"; Content; ToolUseID; Caller }
type BetaWebFetchToolResultBlockParam struct { Type: "web_fetch_tool_result"; Content; ToolUseID; /* 2 more */ }
type BetaWebFetchToolResultErrorBlock struct { Type: "web_fetch_tool_result_error"; ErrorCode }
type BetaWebFetchToolResultErrorBlockParam struct { Type: "web_fetch_tool_result_error"; ErrorCode }
type BetaWebFetchToolResultErrorCode string
One of the following:
const BetaWebFetchToolResultErrorCodeInvalidToolInput BetaWebFetchToolResultErrorCode = "invalid_tool_input"
const BetaWebFetchToolResultErrorCodeURLTooLong BetaWebFetchToolResultErrorCode = "url_too_long"
const BetaWebFetchToolResultErrorCodeURLNotAllowed BetaWebFetchToolResultErrorCode = "url_not_allowed"
const BetaWebFetchToolResultErrorCodeURLNotInPriorContext BetaWebFetchToolResultErrorCode = "url_not_in_prior_context"
const BetaWebFetchToolResultErrorCodeURLNotAccessible BetaWebFetchToolResultErrorCode = "url_not_accessible"
const BetaWebFetchToolResultErrorCodeUnsupportedContentType BetaWebFetchToolResultErrorCode = "unsupported_content_type"
const BetaWebFetchToolResultErrorCodeTooManyRequests BetaWebFetchToolResultErrorCode = "too_many_requests"
const BetaWebFetchToolResultErrorCodeMaxUsesExceeded BetaWebFetchToolResultErrorCode = "max_uses_exceeded"
const BetaWebFetchToolResultErrorCodeUnavailable BetaWebFetchToolResultErrorCode = "unavailable"
const BetaWebFetchToolResultErrorCodeContentTooLarge BetaWebFetchToolResultErrorCode = "content_too_large"
type BetaWebFetchURLSourceAll struct { Type: "all" }

The url_sources variant under which a source contributes in full: every result of the tool filter's source, or all user input.

Type All
type BetaWebFetchURLSourceExcept struct { Type: "except"; Tools }

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

Type Except
Type ToolReference
Name string
type BetaWebFetchURLSourceNone struct { Type: "none" }

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

Type None
type BetaWebFetchURLSourceOnly struct { Type: "only"; Tools }

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

Type Only
Type ToolReference
Name string
type BetaWebFetchURLSourceToolReference struct { Type: "tool_reference"; Name }

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

Type ToolReference
Name string
type BetaWebFetchURLSources struct { 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[].

type BetaWebSearchResultBlock struct { Type: "web_search_result"; EncryptedContent; PageAge; /* 2 more */ }
Type WebSearchResult
defaultweb_search_result
EncryptedContent string
PageAge string
Title string
URL string
type BetaWebSearchResultBlockParam struct { Type: "web_search_result"; EncryptedContent; Title; /* 2 more */ }
Type WebSearchResult
EncryptedContent string
Title string
URL string
PageAge string Optional
type BetaWebSearchTool20250305 struct { Type: "web_search_20250305"; Name; AllowedCallers; /* 7 more */ }
type BetaWebSearchTool20260209 struct { Type: "web_search_20260209"; Name; AllowedCallers; /* 7 more */ }
type BetaWebSearchTool20260318 struct { Type: "web_search_20260318"; Name; AllowedCallers; /* 8 more */ }
type BetaWebSearchToolRequestErrorParam struct { Type: "web_search_tool_result_error"; ErrorCode }
Type WebSearchToolResultError
One of the following:
const BetaWebSearchToolResultErrorCodeInvalidToolInput BetaWebSearchToolResultErrorCode = "invalid_tool_input"
const BetaWebSearchToolResultErrorCodeUnavailable BetaWebSearchToolResultErrorCode = "unavailable"
const BetaWebSearchToolResultErrorCodeMaxUsesExceeded BetaWebSearchToolResultErrorCode = "max_uses_exceeded"
const BetaWebSearchToolResultErrorCodeTooManyRequests BetaWebSearchToolResultErrorCode = "too_many_requests"
const BetaWebSearchToolResultErrorCodeQueryTooLong BetaWebSearchToolResultErrorCode = "query_too_long"
const BetaWebSearchToolResultErrorCodeRequestTooLarge BetaWebSearchToolResultErrorCode = "request_too_large"
type BetaWebSearchToolResultBlock struct { Type: "web_search_tool_result"; Content; ToolUseID; Caller }
type BetaWebSearchToolResultBlockContentUnion interface{…}
One of the following:
type BetaWebSearchToolResultBlockParam struct { Type: "web_search_tool_result"; Content; ToolUseID; /* 2 more */ }
type BetaWebSearchToolResultBlockParamContentUnion interface{…}
One of the following:
type BetaWebSearchToolResultError struct { Type: "web_search_tool_result_error"; ErrorCode }
Type WebSearchToolResultError
defaultweb_search_tool_result_error
One of the following:
const BetaWebSearchToolResultErrorCodeInvalidToolInput BetaWebSearchToolResultErrorCode = "invalid_tool_input"
const BetaWebSearchToolResultErrorCodeUnavailable BetaWebSearchToolResultErrorCode = "unavailable"
const BetaWebSearchToolResultErrorCodeMaxUsesExceeded BetaWebSearchToolResultErrorCode = "max_uses_exceeded"
const BetaWebSearchToolResultErrorCodeTooManyRequests BetaWebSearchToolResultErrorCode = "too_many_requests"
const BetaWebSearchToolResultErrorCodeQueryTooLong BetaWebSearchToolResultErrorCode = "query_too_long"
const BetaWebSearchToolResultErrorCodeRequestTooLarge BetaWebSearchToolResultErrorCode = "request_too_large"
type BetaWebSearchToolResultErrorCode string
One of the following:
const BetaWebSearchToolResultErrorCodeInvalidToolInput BetaWebSearchToolResultErrorCode = "invalid_tool_input"
const BetaWebSearchToolResultErrorCodeUnavailable BetaWebSearchToolResultErrorCode = "unavailable"
const BetaWebSearchToolResultErrorCodeMaxUsesExceeded BetaWebSearchToolResultErrorCode = "max_uses_exceeded"
const BetaWebSearchToolResultErrorCodeTooManyRequests BetaWebSearchToolResultErrorCode = "too_many_requests"
const BetaWebSearchToolResultErrorCodeQueryTooLong BetaWebSearchToolResultErrorCode = "query_too_long"
const BetaWebSearchToolResultErrorCodeRequestTooLarge BetaWebSearchToolResultErrorCode = "request_too_large"

메시지배치

메시지 배치 생성
client.Beta.Messages.Batches.New(ctx, params) (*BetaMessageBatch, error)
POST/v1/messages/batches

메시지 생성 요청의 배치를 전송합니다.

메시지 배치 조회
client.Beta.Messages.Batches.Get(ctx, messageBatchID, query) (*BetaMessageBatch, error)
GET/v1/messages/batches/{message_batch_id}

이 엔드포인트는 멱등성(idempotent)을 가지며 메시지 배치 완료 여부를 폴링하는 데 사용할 수 있습니다. 메시지 배치의 결과에 액세스하려면 응답의 results_url 필드로 요청을 보내세요.

메시지 배치 목록 조회
client.Beta.Messages.Batches.List(ctx, params) (*Page[BetaMessageBatch], error)
GET/v1/messages/batches

워크스페이스 내의 모든 메시지 배치를 나열합니다. 가장 최근에 생성된 배치가 먼저 반환됩니다.

메시지 배치 취소
client.Beta.Messages.Batches.Cancel(ctx, messageBatchID, body) (*BetaMessageBatch, error)
POST/v1/messages/batches/{message_batch_id}/cancel

배치는 처리가 종료되기 전까지 언제든지 취소할 수 있습니다. 취소가 시작되면 배치는 canceling 상태로 전환되며, 이 시점에서 시스템은 취소를 최종 완료하기 전에 진행 중이며 중단할 수 없는 요청을 먼저 완료할 수 있습니다.

메시지 배치 삭제
client.Beta.Messages.Batches.Delete(ctx, messageBatchID, body) (*BetaDeletedMessageBatch, error)
DELETE/v1/messages/batches/{message_batch_id}

메시지 배치를 삭제합니다.

메시지 배치 결과 조회
client.Beta.Messages.Batches.ResultsStreaming(ctx, messageBatchID, query) *jsonl.Stream[BetaMessageBatchIndividualResponse]
GET/v1/messages/batches/{message_batch_id}/results

메시지 배치의 결과를 .jsonl 파일로 스트리밍합니다.