GET

/v1/schemas/anthropic/chat/v1/messages?beta=true?kind=output

kind outputactivity chathash 764c4ecb…extracted Nov 11, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
690622377a5eedc0e9f2265ed755ee34dc0c52d35b47327f425777a550f45e1e
{
  "fetchedAt": 1794374425,
  "extractorVersion": "2",
  "verifiedAt": null
}

Response body

13 properties · 12 required · 194 $defs
propertytypedescriptionconstraints
id*stringUnique object identifier.
type*constObject type."message" · default: "message"
role*constConversational role of the generated message."assistant" · default: "assistant"
content*BetaContentBlock[]Content generated by the model.
model*stringThe model that will complete your prompt.22 known values
stop_reason*enumThe reason that we stopped. This may be one the following values: * `"end_turn"`: the model reached a natural stopping point * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated * `"tool_use"`: the model invoked one or more tools * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue. * `"refusal"`: when streaming classifiers intervene to handle potential policy violations * `"model_context_window_exceeded"`: we exceeded the model's context window In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.end_turn | max_tokens | stop_sequence | tool_use | pause_turn | compaction · +2 more · nullable
stop_sequence*stringWhich custom stop sequence was generated, if any. This value will be a non-null string if one of your custom stop sequences was generated.nullable
stop_details*BetaRefusalStopDetailsStructured information about a refusal.nullable
usage*BetaUsageBilling and rate-limit usage.
diagnostics*BetaDiagnosticsRequest-level diagnostics: why the prompt cache could not fully reuse the prefix of the request named by `diagnostics.previous_message_id`.nullable
context_management*BetaResponseContextManagementContext management response. Information about context management strategies applied during the request.nullable
container*BetaContainerInformation about the container used in the request (for the code execution tool)nullable
input_transformationsBetaInputTransformation[]Changes the API made to the request's input before showing it to the model, and blocks that failed a binding check but were left unchanged: one entry per block, in request order. Two entry types today. `thinking_dropped` — a `thinking`, `redacted_thinking` or `connector_text` block from the request's `messages` that was removed from the prompt instead of being shown to the model because it failed a binding check. `thinking_mismatch_allowed` — a `thinking` or `redacted_thinking` block that failed the conversation check (the conversation before it differs from the one it was created in, or it carries no record of one on a model that requires it) and was shown to the model all the same, because that check is not enforced for this request. More entry types may be added over time; ignore types you do not recognize. Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on every such response from a model that supports extended thinking, as `[]` when there is no entry to report; without the beta, blocks are removed or left in place all the same but nothing is reported. Removed blocks contribute nothing to `usage.input_tokens`; blocks left in place count as sent. When streaming, the array is final in `message_start`; the final `message_delta` event carries it only when a server-side model fallback happened mid-stream, in which case it holds the serving model's entries and replaces the one in `message_start`.nullable

Types

194 $defs

BetaAdvisorMessageIterationUsageobject

Token usage for an advisor sub-inference iteration.

cache_creation*BetaCacheCreationBreakdown of cached tokens by TTLnullable
cache_creation_input_tokens*integerThe number of input tokens used to create the cache entry.n ≥ 0 · default: 0
cache_read_input_tokens*integerThe number of input tokens read from the cache.n ≥ 0 · default: 0
input_tokens*integerThe number of input tokens which were used.n ≥ 0
model*stringThe model that will complete your prompt.22 known values
output_tokens*integerThe number of output tokens which were used.n ≥ 0
type*constUsage for an advisor sub-inference iteration"advisor_message" · default: "advisor_message"

BetaAdvisorTool_20260301object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
cachingBetaCacheControlEphemeralCaching for the advisor's own prompt. When set, each advisor call writes a cache entry at the given TTL so subsequent calls in the same conversation read the stable prefix. When omitted, the advisor prompt is not cached.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
max_tokensintegerBounds the advisor's total output (thinking + text) per call. When the advisor hits this cap, the returned advisor_result or advisor_redacted_result block carries stop_reason='max_tokens', and a truncation note is appended to the advice text the worker model sees (inside the encrypted blob in redacted mode). When set, the API also passes the advisor its remaining-token budget, so the advisor shapes its output toward the cap. When omitted, the advisor model's default output cap applies and the API doesn't pass a budget.n ≥ 1024 · nullable
max_usesintegerMaximum number of times the tool can be used in the API request.n > 0 · nullable
model*stringThe model that will complete your prompt.22 known values
name*constName of the tool."advisor"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"advisor_20260301"

BetaAdvisorToolResultErrorCodeenum

max_uses_exceeded | prompt_too_long | too_many_requests | overloaded | unavailable | execution_time_exceeded · +1 more

BetaAllowedCallerenum

Specifies who can invoke a tool.

direct | code_execution_20250825 | code_execution_20260120 | code_execution_20260521

BetaBase64PDFSourceobject

data*stringformat: byte
media_type*const"application/pdf"
type*const"base64"

BetaBashCodeExecutionToolResultErrorCodeenum

invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | output_file_too_large

BetaBashTool_20241022object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
input_examplesobject[]
name*constName of the tool."bash"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"bash_20241022"

BetaBashTool_20250124object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
input_examplesobject[]
name*constName of the tool."bash"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"bash_20250124"

BetaBrowserCloseTabConfigobject

``close_tab``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserDoubleClickConfigobject

``double_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserFileUploadConfigobject

``file_upload``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserFindConfigobject

``find``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserFormInputConfigobject

``form_input``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserGetPageTextConfigobject

``get_page_text``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserHoldKeyConfigobject

``hold_key``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserHoverConfigobject

``hover``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserJavascriptExecConfigobject

``javascript_exec``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserKeyConfigobject

``key``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserLeftClickConfigobject

``left_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserLeftClickDragConfigobject

``left_click_drag``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserLeftMouseDownConfigobject

``left_mouse_down``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserLeftMouseUpConfigobject

``left_mouse_up``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserListTabsConfigobject

``list_tabs``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserMiddleClickConfigobject

``middle_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserMouseMoveConfigobject

``mouse_move``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserNavigateConfigobject

``navigate``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserNewTabConfigobject

``new_tab``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserReadConsoleConfigobject

``read_console``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserReadNetworkConfigobject

``read_network``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserReadPageConfigobject

``read_page``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserRightClickConfigobject

``right_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserScreenshotConfigobject

``screenshot``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserScrollConfigobject

``scroll``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserScrollToConfigobject

``scroll_to``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserSwitchTabConfigobject

``switch_tab``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserToolset_20260801object

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.

cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
configsBetaBrowserToolsetConfigsPer-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 a…nullable
type*const"browser_toolset_20260801"

BetaBrowserToolsetConfigsobject

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 a…

close_tabBetaBrowserCloseTabConfig``close_tab``'s config overrides.nullable
double_clickBetaBrowserDoubleClickConfig``double_click``'s config overrides.nullable
file_uploadBetaBrowserFileUploadConfig``file_upload``'s config overrides.nullable
findBetaBrowserFindConfig``find``'s config overrides.nullable
form_inputBetaBrowserFormInputConfig``form_input``'s config overrides.nullable
get_page_textBetaBrowserGetPageTextConfig``get_page_text``'s config overrides.nullable
hold_keyBetaBrowserHoldKeyConfig``hold_key``'s config overrides.nullable
hoverBetaBrowserHoverConfig``hover``'s config overrides.nullable
javascript_execBetaBrowserJavascriptExecConfig``javascript_exec``'s config overrides.nullable
keyBetaBrowserKeyConfig``key``'s config overrides.nullable
left_clickBetaBrowserLeftClickConfig``left_click``'s config overrides.nullable
left_click_dragBetaBrowserLeftClickDragConfig``left_click_drag``'s config overrides.nullable
left_mouse_downBetaBrowserLeftMouseDownConfig``left_mouse_down``'s config overrides.nullable
left_mouse_upBetaBrowserLeftMouseUpConfig``left_mouse_up``'s config overrides.nullable
list_tabsBetaBrowserListTabsConfig``list_tabs``'s config overrides.nullable
middle_clickBetaBrowserMiddleClickConfig``middle_click``'s config overrides.nullable
mouse_moveBetaBrowserMouseMoveConfig``mouse_move``'s config overrides.nullable
navigateBetaBrowserNavigateConfig``navigate``'s config overrides.nullable
new_tabBetaBrowserNewTabConfig``new_tab``'s config overrides.nullable
read_consoleBetaBrowserReadConsoleConfig``read_console``'s config overrides.nullable
read_networkBetaBrowserReadNetworkConfig``read_network``'s config overrides.nullable
read_pageBetaBrowserReadPageConfig``read_page``'s config overrides.nullable
right_clickBetaBrowserRightClickConfig``right_click``'s config overrides.nullable
screenshotBetaBrowserScreenshotConfig``screenshot``'s config overrides.nullable
scrollBetaBrowserScrollConfig``scroll``'s config overrides.nullable
scroll_toBetaBrowserScrollToConfig``scroll_to``'s config overrides.nullable
switch_tabBetaBrowserSwitchTabConfig``switch_tab``'s config overrides.nullable
triple_clickBetaBrowserTripleClickConfig``triple_click``'s config overrides.nullable
typeBetaBrowserTypeConfig``type``'s config overrides.nullable
waitBetaBrowserWaitConfig``wait``'s config overrides.nullable
zoomBetaBrowserZoomConfig``zoom``'s config overrides.nullable

BetaBrowserTripleClickConfigobject

``triple_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserTypeConfigobject

``type``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserWaitConfigobject

``wait``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaBrowserZoomConfigobject

``zoom``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaCacheControlEphemeralobject

ttlenumThe time-to-live for the cache control breakpoint.5m | 1h
type*const"ephemeral"

BetaCacheCreationobject

ephemeral_1h_input_tokens*integerThe number of input tokens used to create the 1 hour cache entry.n ≥ 0 · default: 0
ephemeral_5m_input_tokens*integerThe number of input tokens used to create the 5 minute cache entry.n ≥ 0 · default: 0

BetaCacheMissMessagesChangedobject

A `cache_miss_reason` for a request whose `messages` differ from the previous request's in an earlier entry, instead of only having entries appended. The `model`, `system`, and `tools` match.

cache_missed_input_tokens*integerApproximate number of input tokens that would have been read from cache had the prefix matched the previous request.
type*const"messages_changed" · default: "messages_changed"

BetaCacheMissModelChangedobject

A `cache_miss_reason` for a request whose `model` or `speed` differs from the previous request's.

cache_missed_input_tokens*integerApproximate number of input tokens that would have been read from cache had the prefix matched the previous request.
type*const"model_changed" · default: "model_changed"

BetaCacheMissPreviousMessageNotFoundobject

A `cache_miss_reason` for when the API doesn't have a stored record of the request that `diagnostics.previous_message_id` references.

type*const"previous_message_not_found" · default: "previous_message_not_found"

BetaCacheMissReasonCacheMissModelChanged | CacheMissSystemChanged | CacheMissToolsChanged | …

BetaCacheMissSystemChangedobject

A `cache_miss_reason` for a request whose `system` differs from the previous request's.

cache_missed_input_tokens*integerApproximate number of input tokens that would have been read from cache had the prefix matched the previous request.
type*const"system_changed" · default: "system_changed"

BetaCacheMissToolsChangedobject

A `cache_miss_reason` for a request whose `tools` differ from the previous request's, for example because tools were added, removed, or reordered.

cache_missed_input_tokens*integerApproximate number of input tokens that would have been read from cache had the prefix matched the previous request.
type*const"tools_changed" · default: "tools_changed"

BetaCacheMissUnavailableobject

A `cache_miss_reason` for when the API can't give a diagnosis. The request itself was processed normally.

type*const"unavailable" · default: "unavailable"

BetaCodeExecutionTool_20250522object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
name*constName of the tool."code_execution"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"code_execution_20250522"

BetaCodeExecutionTool_20250825object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
name*constName of the tool."code_execution"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"code_execution_20250825"

BetaCodeExecutionTool_20260120object

A `tools` entry for the code execution tool, version `code_execution_20260120`. It adds REPL state persistence to version `code_execution_20250825`.

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
name*constName of the tool."code_execution"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"code_execution_20260120"

BetaCodeExecutionTool_20260521object

Code execution tool with REPL state persistence.

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
name*constName of the tool."code_execution"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"code_execution_20260521"

BetaCodeExecutionToolResultErrorCodeenum

invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded

BetaCompactionIterationUsageobject

Token usage for a compaction iteration.

cache_creation*BetaCacheCreationBreakdown of cached tokens by TTLnullable
cache_creation_input_tokens*integerThe number of input tokens used to create the cache entry.n ≥ 0 · default: 0
cache_read_input_tokens*integerThe number of input tokens read from the cache.n ≥ 0 · default: 0
input_tokens*integerThe number of input tokens which were used.n ≥ 0
output_tokens*integerThe number of output tokens which were used.n ≥ 0
type*constUsage for a compaction iteration"compaction" · default: "compaction"

BetaComputerCursorPositionConfigobject

``cursor_position``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerDoubleClickConfigobject

``double_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerHoldKeyConfigobject

``hold_key``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerKeyConfigobject

``key``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerLeftClickConfigobject

``left_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerLeftClickDragConfigobject

``left_click_drag``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerLeftMouseDownConfigobject

``left_mouse_down``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerLeftMouseUpConfigobject

``left_mouse_up``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerMiddleClickConfigobject

``middle_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerMouseMoveConfigobject

``mouse_move``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerRightClickConfigobject

``right_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerScreenshotConfigobject

``screenshot``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerScrollConfigobject

``scroll``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerToolset_20260801object

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 in…

cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
configsBetaComputerToolsetConfigsPer-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 …nullable
type*const"computer_toolset_20260801"

BetaComputerToolsetConfigsobject

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 …

cursor_positionBetaComputerCursorPositionConfig``cursor_position``'s config overrides.nullable
double_clickBetaComputerDoubleClickConfig``double_click``'s config overrides.nullable
hold_keyBetaComputerHoldKeyConfig``hold_key``'s config overrides.nullable
keyBetaComputerKeyConfig``key``'s config overrides.nullable
left_clickBetaComputerLeftClickConfig``left_click``'s config overrides.nullable
left_click_dragBetaComputerLeftClickDragConfig``left_click_drag``'s config overrides.nullable
left_mouse_downBetaComputerLeftMouseDownConfig``left_mouse_down``'s config overrides.nullable
left_mouse_upBetaComputerLeftMouseUpConfig``left_mouse_up``'s config overrides.nullable
middle_clickBetaComputerMiddleClickConfig``middle_click``'s config overrides.nullable
mouse_moveBetaComputerMouseMoveConfig``mouse_move``'s config overrides.nullable
right_clickBetaComputerRightClickConfig``right_click``'s config overrides.nullable
screenshotBetaComputerScreenshotConfig``screenshot``'s config overrides.nullable
scrollBetaComputerScrollConfig``scroll``'s config overrides.nullable
triple_clickBetaComputerTripleClickConfig``triple_click``'s config overrides.nullable
typeBetaComputerTypeConfig``type``'s config overrides.nullable
waitBetaComputerWaitConfig``wait``'s config overrides.nullable
zoomBetaComputerZoomConfig``zoom``'s config overrides.nullable

BetaComputerTripleClickConfigobject

``triple_click``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerTypeConfigobject

``type``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerUseTool_20241022object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
display_height_px*integerThe height of the display in pixels.n ≥ 1
display_numberintegerThe X11 display number (e.g. 0, 1) for the display.n ≥ 0 · nullable
display_width_px*integerThe width of the display in pixels.n ≥ 1
input_examplesobject[]
name*constName of the tool."computer"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"computer_20241022"

BetaComputerUseTool_20250124object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
display_height_px*integerThe height of the display in pixels.n ≥ 1
display_numberintegerThe X11 display number (e.g. 0, 1) for the display.n ≥ 0 · nullable
display_width_px*integerThe width of the display in pixels.n ≥ 1
input_examplesobject[]
name*constName of the tool."computer"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"computer_20250124"

BetaComputerUseTool_20251124object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
display_height_px*integerThe height of the display in pixels.n ≥ 1
display_numberintegerThe X11 display number (e.g. 0, 1) for the display.n ≥ 0 · nullable
display_width_px*integerThe width of the display in pixels.n ≥ 1
enable_zoombooleanWhether to enable an action to take a zoomed-in screenshot of the screen.
input_examplesobject[]
name*constName of the tool."computer"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"computer_20251124"

BetaComputerWaitConfigobject

``wait``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaComputerZoomConfigobject

``zoom``'s config overrides.

defer_loadingbooleanDefer loading for this member. Must resolve to the same value on every enabled member of the toolset.nullable
enabledbooleanWhether 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.nullable

BetaContainerobject

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

expires_at*stringThe time at which the container will expire.format: date-time
id*stringIdentifier for the container used in this request
skills*BetaContainerSkill[]Skills loaded in the containernullable

BetaContainerSkillobject

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

skill_id*stringSkill IDlength ≥ 1 · length ≤ 64
type*enumType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)anthropic | custom
version*stringThe resolved version: a skill version ID for custom skills.length ≥ 1 · length ≤ 64

BetaContentBlockResponseTextBlock | ResponseThinkingBlock | ResponseRedactedThinkingBlock | …

BetaDiagnosticsobject

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

cache_miss_reason*CacheMissModelChanged | CacheMissSystemChanged | CacheMissToolsChanged | …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.nullable

BetaDirectCallerobject

Tool invocation directly from the model.

type*const"direct"

BetaFallbackCreditNotAppliedobject

No reprice was applied; ``reason`` says why.

reason*enumWhy the reprice was not applied.body_mismatch | continuation_excluded | continuation_only | expired | invalid_target_model | not_enabled · +6 more
remove_to_redeemstring[]Request fields to remove before retrying, so the retry can redeem this token. Present exactly when `reason` is `variant_fields_present` — never null, never an empty array; absent otherwise. Fields are named only from your own request, and only after the sealed variant hash matched. A served best-effort retry has already been billed at normal price; nothing redeems retroactively, but a corrected re-send inside the token's five-minute window can still redeem.nullable
type*const"not_applied" · default: "not_applied"

BetaFallbackCreditRedeemedobject

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

type*const"redeemed" · default: "redeemed"

BetaFallbackCreditUsageobject

Outcome of the ``fallback_credit_token`` presented on this request.

status*FallbackCreditRedeemed | FallbackCreditNotAppliedWhether the fallback-credit reprice was applied to this response's billing.

BetaFallbackMessageIterationUsageobject

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

cache_creation*BetaCacheCreationBreakdown of cached tokens by TTLnullable
cache_creation_input_tokens*integerThe number of input tokens used to create the cache entry.n ≥ 0 · default: 0
cache_read_input_tokens*integerThe number of input tokens read from the cache.n ≥ 0 · default: 0
input_tokens*integerThe number of input tokens which were used.n ≥ 0
model*stringThe model that will complete your prompt.22 known values
output_tokens*integerThe number of output tokens which were used.n ≥ 0
type*constUsage for the fallback-model attempt that served the response"fallback_message" · default: "fallback_message"

BetaFallbackRefusalTriggerobject

The `from` model declined for policy reasons.

category*stringThe policy category that triggered a refusal.5 known values · nullable
type*const"refusal" · default: "refusal"

BetaInputTransformationThinkingDroppedInputTransformation | ThinkingMismatchAllowedInputTransformation

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.

BetaIterationsUsageBetaMessageIterationUsage | BetaCompactionIterationUsage | BetaAdvisorMessageIterationUsage[]

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.

nullable

BetaJsonValueany

BetaMCPToolobject

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

descriptionstringThe tool's description as the MCP server lists it.nullable
input_schema*objectThe tool's input schema as the MCP server lists it, verbatim.
name*stringThe tool's name as the MCP server lists it (not prefixed with the server name).length ≥ 1

BetaMCPToolConfigobject

Configuration for a specific tool in an MCP toolset.

defer_loadingboolean
enabledboolean

BetaMCPToolDefaultConfigobject

Default configuration for tools in an MCP toolset.

defer_loadingboolean
enabledboolean

BetaMCPToolsetobject

Configuration for a group of tools from an MCP server.

cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
configsobjectConfiguration overrides for specific tools, keyed by tool namenullable
default_configBetaMCPToolDefaultConfigDefault configuration applied to all tools from this server
mcp_server_name*stringName of the MCP server to configure tools forlength ≥ 1 · length ≤ 255
toolsBetaMCPTool[]The server's tool listing, pinned: when present, the server is not asked for its tools before sampling and exactly these entries, with `default_config` and `configs` applied, are the toolset's tools. Copy it from the `mcp_tool_listing` block of an earlier response.nullable
type*const"mcp_toolset"

BetaMemoryTool_20250818object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
input_examplesobject[]
name*constName of the tool."memory"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"memory_20250818"

BetaMessageIterationUsageobject

Token usage for a sampling iteration.

cache_creation*BetaCacheCreationBreakdown of cached tokens by TTLnullable
cache_creation_input_tokens*integerThe number of input tokens used to create the cache entry.n ≥ 0 · default: 0
cache_read_input_tokens*integerThe number of input tokens read from the cache.n ≥ 0 · default: 0
input_tokens*integerThe number of input tokens which were used.n ≥ 0
model*stringThe model that will complete your prompt.22 known values · nullable
output_tokens*integerThe number of output tokens which were used.n ≥ 0
type*constUsage for a sampling iteration"message" · default: "message"

BetaOutputTokensDetailsobject

thinking_tokens*integerNumber of output tokens the model generated as internal reasoning, including the thinking-block delimiter tokens.n ≥ 0 · default: 0

BetaPlainTextSourceobject

data*string
media_type*const"text/plain"
type*const"text"

BetaRefusalCategorystring

The policy category that triggered a refusal.

5 known values

BetaRefusalStopDetailsobject

Structured information about a refusal.

category*stringThe policy category that triggered a refusal.5 known values · nullable
explanation*stringHuman-readable explanation of the refusal. This text is not guaranteed to be stable. `null` when no explanation is available for the category.nullable
fallback_credit_token*stringOpaque code that refunds the cache-miss cost when retrying this refused request on the fallback model. Pass it as `fallback_credit_token` on the retry request. Expires 5 minutes after the refusal. The retry is sent either with the same request body (`system`, `messages`, `tools`, and other render-shaping fields), or with the same body plus one appended `assistant` message whose content is the partial text (with any trailing whitespace stripped from the final text block) and paired server-tool blocks from this refusal — which also authorizes that appended turn as an assistant-prefill continuation on models that otherwise disallow prefill. A token minted mid-server-tool-loop whose partial content was continuable may only be redeemed the second way — if a same-body retry is rejected with a 400 saying the token must be redeemed by continuing the partial response, retry the second way instead. Either way: same workspace, same platform; a mismatch is a 400. Resending a token for an already-warm prefix is permitted but yields no additional credit. `null` when the refused model isn't eligible for a fallback credit.nullable
fallback_has_prefill_claim*booleanWhether the accompanying `fallback_credit_token` may be redeemed with the appended-assistant retry form. Only set when `fallback_credit_token` is present. `true`: retry by resending the same request body plus one appended `assistant` message whose content is this response's `content` with any trailing whitespace stripped from the final text block and unpaired `tool_use` blocks omitted (the same appended-turn shape described on `fallback_credit_token`), with the token attached. `false`: retry by resending the original request body unchanged, with the token attached — the appended-assistant form is not available for this refusal (no continuable partial content, or the request uses `output_format` or a `tool_choice` that forces tool use). One exception: when the request used `output_format` or a forced `tool_choice` and the refusal arrived after server tools (including MCP connector tools) had already executed, the token may not be redeemable by either retry form; if the exact-body retry is then rejected with a 400 saying the token must be redeemed by continuing the partial response, discard the token and retry without it. Advisory: if an appended-assistant retry is rejected with a 400 despite `true`, fall back to resending the original request body with the token.nullable
recommended_model*stringThe server's suggested retry target for this refusal. Populated when a fallback attempt could not be made (the fallback model's rate limit was exhausted, or it was overloaded); names the fallback model the caller can retry directly. Null otherwise.nullable
type*const"refusal" · default: "refusal"

BetaRequestCitationsConfigobject

enabledboolean

BetaResponseAdvisorRedactedResultBlockobject

encrypted_content*stringOpaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
stop_reason*stringThe advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).nullable
type*const"advisor_redacted_result" · default: "advisor_redacted_result"

BetaResponseAdvisorResultBlockobject

stop_reason*stringThe 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.nullable
text*string
type*const"advisor_result" · default: "advisor_result"

BetaResponseAdvisorToolResultBlockobject

content*ResponseAdvisorToolResultError | ResponseAdvisorResultBlock | ResponseAdvisorRedactedResultBlock
tool_use_id*string
type*const"advisor_tool_result" · default: "advisor_tool_result"

BetaResponseAdvisorToolResultErrorobject

error_code*enummax_uses_exceeded | prompt_too_long | too_many_requests | overloaded | unavailable | execution_time_exceeded · +1 more
type*const"advisor_tool_result_error" · default: "advisor_tool_result_error"

BetaResponseBashCodeExecutionOutputBlockobject

file_id*string
type*const"bash_code_execution_output" · default: "bash_code_execution_output"

BetaResponseBashCodeExecutionResultBlockobject

content*BetaResponseBashCodeExecutionOutputBlock[]
return_code*integer
stderr*string
stdout*string
type*const"bash_code_execution_result" · default: "bash_code_execution_result"

BetaResponseBashCodeExecutionToolResultBlockobject

content*ResponseBashCodeExecutionToolResultError | ResponseBashCodeExecutionResultBlock
tool_use_id*string
type*const"bash_code_execution_tool_result… · default: "bash_code_execution_tool_result…

BetaResponseBashCodeExecutionToolResultErrorobject

error_code*enuminvalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | output_file_too_large
type*const"bash_code_execution_tool_result… · default: "bash_code_execution_tool_result…

BetaResponseCharLocationCitationobject

cited_text*string
document_index*integern ≥ 0
document_title*stringnullable
end_char_index*integer
file_id*stringnullable
start_char_index*integern ≥ 0
type*const"char_location" · default: "char_location"

BetaResponseCitationsConfigobject

enabled*booleandefault: false

BetaResponseClearThinking20251015Editobject

cleared_input_tokens*integerNumber of input tokens cleared by this edit.n ≥ 0
cleared_thinking_turns*integerNumber of thinking turns that were cleared.n ≥ 0
type*constThe type of context management edit applied."clear_thinking_20251015" · default: "clear_thinking_20251015"

BetaResponseClearToolUses20250919Editobject

cleared_input_tokens*integerNumber of input tokens cleared by this edit.n ≥ 0
cleared_tool_uses*integerNumber of tool uses that were cleared.n ≥ 0
type*constThe type of context management edit applied."clear_tool_uses_20250919" · default: "clear_tool_uses_20250919"

BetaResponseCodeExecutionOutputBlockobject

file_id*string
type*const"code_execution_output" · default: "code_execution_output"

BetaResponseCodeExecutionResultBlockobject

content*BetaResponseCodeExecutionOutputBlock[]
return_code*integer
stderr*string
stdout*string
type*const"code_execution_result" · default: "code_execution_result"

BetaResponseCodeExecutionToolResultBlockobject

content*ResponseCodeExecutionToolResultError | ResponseCodeExecutionResultBlock | ResponseEncryptedCodeExecutionResultBlock
tool_use_id*string
type*const"code_execution_tool_result" · default: "code_execution_tool_result"

BetaResponseCodeExecutionToolResultErrorobject

error_code*enuminvalid_tool_input | unavailable | too_many_requests | execution_time_exceeded
type*const"code_execution_tool_result_erro… · default: "code_execution_tool_result_erro…

BetaResponseCompactionBlockobject

A compaction block returned when autocompact is triggered.

content*stringSummary of compacted content, or null if compaction failednullable
encrypted_content*stringOpaque metadata from prior compaction, to be round-tripped verbatimnullable
signaturestringSignature over the summary, to be sent back with the block verbatimnullable
tool_changesBetaResponseToolAdditionBlock | BetaResponseToolRemovalBlock[]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.nullable
type*const"compaction" · default: "compaction"

BetaResponseContainerUploadBlockobject

Response model for a file uploaded to the container.

file_id*string
type*const"container_upload" · default: "container_upload"

BetaResponseContentBlockLocationCitationobject

cited_text*stringThe full text of the cited block range, concatenated.
document_index*integern ≥ 0
document_title*stringnullable
end_block_index*integerExclusive 0-based end index of the cited block range in the source's `content` array.
file_id*stringnullable
start_block_index*integer0-based index of the first cited block in the source's `content` array.n ≥ 0
type*const"content_block_location" · default: "content_block_location"

BetaResponseContextManagementobject

applied_edits*BetaResponseClearToolUses20250919Edit | BetaResponseClearThinking20251015Edit[]List of context management edits that were applied.

BetaResponseDocumentBlockobject

citations*BetaResponseCitationsConfigCitation configuration for the documentnullable
source*Base64PDFSource | PlainTextSource
title*stringThe title of the documentnullable
type*const"document" · default: "document"

BetaResponseEncryptedCodeExecutionResultBlockobject

The output and exit code of Python code that Claude ran with the code execution tool, with standard output in encrypted form.

content*BetaResponseCodeExecutionOutputBlock[]
encrypted_stdout*string
return_code*integer
stderr*string
type*const"encrypted_code_execution_result… · default: "encrypted_code_execution_result…

BetaResponseFallbackBlockobject

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

from*BetaResponseFallbackHopInfoThe model whose output ends at this point — the model that declined at this hop. When the declining hop is the requested model, its `model` echoes the top-level `model` string the caller sent (alias or canonical); when the declining hop is a fallback model, it…
to*BetaResponseFallbackHopInfoThe fallback model producing the content that follows this block. Its `model` is always the canonical id.
trigger*BetaFallbackRefusalTriggerWhat caused the `from` model to hand over at this hop.
type*const"fallback" · default: "fallback"

BetaResponseFallbackHopInfoobject

Identifies one hop of a fallback transition.

model*stringThe model that will complete your prompt.22 known values

BetaResponseMCPToolobject

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

descriptionstring
input_schema*object
name*string

BetaResponseMCPToolListingBlockobject

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.

mcp_server_name*string
tools*BetaResponseMCPTool[]
type*const"mcp_tool_listing" · default: "mcp_tool_listing"

BetaResponseMCPToolResultBlockobject

content*string | BetaResponseTextBlock[]
is_error*booleandefault: false
tool_use_id*string
type*const"mcp_tool_result" · default: "mcp_tool_result"

BetaResponseMCPToolUseBlockobject

id*string
input*object
name*stringThe name of the MCP tool
server_name*stringThe name of the MCP server
type*const"mcp_tool_use" · default: "mcp_tool_use"

BetaResponsePageLocationCitationobject

cited_text*string
document_index*integern ≥ 0
document_title*stringnullable
end_page_number*integer
file_id*stringnullable
start_page_number*integern ≥ 1
type*const"page_location" · default: "page_location"

BetaResponseRedactedThinkingBlockobject

data*stringThe contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.
type*const"redacted_thinking" · default: "redacted_thinking"

BetaResponseSearchResultLocationCitationobject

cited_text*stringThe full text of the cited block range, concatenated.
end_block_index*integerExclusive 0-based end index of the cited block range in the source's `content` array.
search_result_index*integer0-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.n ≥ 0
source*string
start_block_index*integer0-based index of the first cited block in the source's `content` array.n ≥ 0
title*stringnullable
type*const"search_result_location" · default: "search_result_location"

BetaResponseServerToolUseBlockobject

callerDirectCaller | ServerToolCaller | ServerToolCaller_20260120
id*string
input*object
name*enumadvisor | web_search | web_fetch | code_execution | bash_code_execution | text_editor_code_execution · +2 more
type*const"server_tool_use" · default: "server_tool_use"

BetaResponseTextBlockobject

citations*BetaResponseCharLocationCitation | BetaResponsePageLocationCitation | BetaResponseContentBlockLocationCitation[]Citations supporting the text block. The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.nullable
text*stringlength ≥ 0
type*const"text" · default: "text"

BetaResponseTextEditorCodeExecutionCreateResultBlockobject

is_file_update*boolean
type*const"text_editor_code_execution_crea… · default: "text_editor_code_execution_crea…

BetaResponseTextEditorCodeExecutionStrReplaceResultBlockobject

lines*string[]nullable
new_lines*integernullable
new_start*integernullable
old_lines*integernullable
old_start*integernullable
type*const"text_editor_code_execution_str_… · default: "text_editor_code_execution_str_…

BetaResponseTextEditorCodeExecutionToolResultBlockobject

content*ResponseTextEditorCodeExecutionToolResultError | ResponseTextEditorCodeExecutionViewResultBlock | ResponseTextEditorCodeExecutionCreateResultBlock | …
tool_use_id*string
type*const"text_editor_code_execution_tool… · default: "text_editor_code_execution_tool…

BetaResponseTextEditorCodeExecutionToolResultErrorobject

error_code*enuminvalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | file_not_found
error_message*stringnullable
type*const"text_editor_code_execution_tool… · default: "text_editor_code_execution_tool…

BetaResponseTextEditorCodeExecutionViewResultBlockobject

content*string
file_type*enumtext | image | pdf
num_lines*integernullable
start_line*integernullable
total_lines*integernullable
type*const"text_editor_code_execution_view… · default: "text_editor_code_execution_view…

BetaResponseThinkingBlockobject

signature*stringA value used to verify that this thinking block was generated by Claude when it is passed back to the API.
thinking*stringThe text of Claude's thinking process for this block.
type*const"thinking" · default: "thinking"

BetaResponseToolobject

A custom tool definition, as sent.

typeconst"custom" · nullable
descriptionstringDescription of what this tool does.
name*stringName of the tool.length ≥ 1 · length ≤ 128
input_schema*object[JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
strictbooleanWhen true, guarantees schema validation on tool names and inputs
eager_input_streamingbooleanEnable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.nullable
allowed_callersBetaAllowedCaller[]
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
input_examplesobject[]

BetaResponseToolAdditionBlockobject

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.

tool*ResponseToolChangeToolReference | ResponseToolChangeMCPToolReference | ResponseToolChangeMCPToolsetReference | …The tool made available: a reference to a `tools` entry or MCP toolset, or a `tool_definition` carrying the definition by value.
type*const"tool_addition" · default: "tool_addition"

BetaResponseToolChangeMCPToolReferenceobject

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.

name*string
server_name*string
type*const"mcp_tool_reference" · default: "mcp_tool_reference"

BetaResponseToolChangeMCPToolsetReferenceobject

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.

server_name*string
type*const"mcp_toolset_reference" · default: "mcp_toolset_reference"

BetaResponseToolChangeToolDefinitionobject

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.

definition*ResponseTool | BashTool_20241022 | BashTool_20250124 | …
type*const"tool_definition" · default: "tool_definition"

BetaResponseToolChangeToolReferenceobject

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.

name*string
type*const"tool_reference" · default: "tool_reference"

BetaResponseToolReferenceBlockobject

tool_name*stringlength ≥ 1 · length ≤ 256
type*const"tool_reference" · default: "tool_reference"

BetaResponseToolRemovalBlockobject

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.

tool*ResponseToolChangeToolReference | ResponseToolChangeMCPToolReference | ResponseToolChangeMCPToolsetReferenceA reference to the withdrawn `tools` entry, MCP tool or MCP toolset.
type*const"tool_removal" · default: "tool_removal"

BetaResponseToolSearchToolResultBlockobject

content*ResponseToolSearchToolResultError | ResponseToolSearchToolSearchResultBlock
tool_use_id*string
type*const"tool_search_tool_result" · default: "tool_search_tool_result"

BetaResponseToolSearchToolResultErrorobject

error_code*enuminvalid_tool_input | unavailable | too_many_requests | execution_time_exceeded
error_message*stringnullable
type*const"tool_search_tool_result_error" · default: "tool_search_tool_result_error"

BetaResponseToolSearchToolSearchResultBlockobject

tool_references*BetaResponseToolReferenceBlock[]
type*const"tool_search_tool_search_result" · default: "tool_search_tool_search_result"

BetaResponseToolUnionResponseTool | BashTool_20241022 | BashTool_20250124 | …

BetaResponseToolUseBlockobject

callerDirectCaller | ServerToolCaller | ServerToolCaller_20260120
id*string
input*object
name*stringlength ≥ 1
toolset_namestringFor a toolset member tool_use, the toolset family.length ≥ 1 · length ≤ 64 · nullable
type*const"tool_use" · default: "tool_use"

BetaResponseWebFetchResultBlockobject

content*BetaResponseDocumentBlock
retrieved_at*stringISO 8601 timestamp when the content was retrievednullable
type*const"web_fetch_result" · default: "web_fetch_result"
url*stringFetched content URL

BetaResponseWebFetchToolResultBlockobject

callerDirectCaller | ServerToolCaller | ServerToolCaller_20260120
content*ResponseWebFetchToolResultError | ResponseWebFetchResultBlock
tool_use_id*string
type*const"web_fetch_tool_result" · default: "web_fetch_tool_result"

BetaResponseWebFetchToolResultErrorobject

error_code*enuminvalid_tool_input | url_too_long | url_not_allowed | url_not_in_prior_context | url_not_accessible | unsupported_content_type · +4 more
type*const"web_fetch_tool_result_error" · default: "web_fetch_tool_result_error"

BetaResponseWebSearchResultBlockobject

encrypted_content*string
page_age*stringnullable
title*string
type*const"web_search_result" · default: "web_search_result"
url*string

BetaResponseWebSearchResultLocationCitationobject

cited_text*string
encrypted_index*string
title*stringlength ≤ 512 · nullable
type*const"web_search_result_location" · default: "web_search_result_location"
url*string

BetaResponseWebSearchToolResultBlockobject

callerDirectCaller | ServerToolCaller | ServerToolCaller_20260120
content*ResponseWebSearchToolResultError | BetaResponseWebSearchResultBlock[]
tool_use_id*string
type*const"web_search_tool_result" · default: "web_search_tool_result"

BetaResponseWebSearchToolResultErrorobject

error_code*enuminvalid_tool_input | unavailable | max_uses_exceeded | too_many_requests | query_too_long | request_too_large
type*const"web_search_tool_result_error" · default: "web_search_tool_result_error"

BetaServerToolCallerobject

Tool invocation generated by a server-side tool.

tool_id*string
type*const"code_execution_20250825"

BetaServerToolCaller_20260120object

tool_id*string
type*const"code_execution_20260120"

BetaServerToolUsageobject

web_fetch_requests*integerThe number of web fetch tool requests.n ≥ 0 · default: 0
web_search_requests*integerThe number of web search tool requests.n ≥ 0 · default: 0

BetaSpeedenum

standard | fast

BetaStopReasonenum

end_turn | max_tokens | stop_sequence | tool_use | pause_turn | compaction · +2 more

BetaTextEditor_20241022object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
input_examplesobject[]
name*constName of the tool."str_replace_editor"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"text_editor_20241022"

BetaTextEditor_20250124object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
input_examplesobject[]
name*constName of the tool."str_replace_editor"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"text_editor_20250124"

BetaTextEditor_20250429object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
input_examplesobject[]
name*constName of the tool."str_replace_based_edit_tool"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"text_editor_20250429"

BetaTextEditor_20250728object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
input_examplesobject[]
max_charactersintegerMaximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.n ≥ 1 · nullable
name*constName of the tool."str_replace_based_edit_tool"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"text_editor_20250728"

BetaTextEditorCodeExecutionToolResultErrorCodeenum

invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | file_not_found

BetaThinkingDroppedInputTransformationobject

path*stringWhere 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*enumWhich 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 th…model_binding_mismatch | prefix_binding_mismatch | organization_binding_mismatch | end_user_binding_mismatch
type*constAlways `thinking_dropped` for this entry type."thinking_dropped" · default: "thinking_dropped"

BetaThinkingMismatchAllowedInputTransformationobject

path*stringWhere 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*enumWhich 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 th…model_binding_mismatch | prefix_binding_mismatch | organization_binding_mismatch | end_user_binding_mismatch
type*constAlways `thinking_mismatch_allowed` for this entry type."thinking_mismatch_allowed" · default: "thinking_mismatch_allowed"

BetaToolSearchToolBM25_20251119object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
name*constName of the tool."tool_search_tool_bm25"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*enumtool_search_tool_bm25_20251119 | tool_search_tool_bm25

BetaToolSearchToolRegex_20251119object

allowed_callersBetaAllowedCaller[]
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
name*constName of the tool."tool_search_tool_regex"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*enumtool_search_tool_regex_20251119… | tool_search_tool_regex

BetaToolSearchToolResultErrorCodeenum

invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded

BetaUsageobject

cache_creation*BetaCacheCreationBreakdown of cached tokens by TTLnullable
cache_creation_input_tokens*integerThe number of input tokens used to create the cache entry.n ≥ 0 · nullable
cache_read_input_tokens*integerThe number of input tokens read from the cache.n ≥ 0 · nullable
fallback_credit*BetaFallbackCreditUsageOutcome of the ``fallback_credit_token`` presented on this request.nullable
inference_geo*stringThe geographic region where inference was performed for this request.nullable
input_tokens*integerThe number of input tokens which were used.n ≥ 0
iterations*BetaMessageIterationUsage | BetaCompactionIterationUsage | BetaAdvisorMessageIterationUsage[]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.nullable
output_tokens*integerThe number of output tokens which were used.n ≥ 0
output_tokens_details*BetaOutputTokensDetailsBreakdown of output tokens by category. `output_tokens` remains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you.nullable
server_tool_use*BetaServerToolUsageThe number of server tool requests.nullable
service_tier*enumIf the request used the priority, standard, or batch tier.standard | priority | batch · nullable
speed*enumThe inference speed mode used for this request.standard | fast · nullable

BetaUserLocationobject

citystringThe city of the user.length ≥ 1 · length ≤ 255 · nullable
countrystringThe two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.length ≥ 2 · length ≤ 2 · nullable
regionstringThe region of the user.length ≥ 1 · length ≤ 255 · nullable
timezonestringThe [IANA timezone](https://nodatime.org/TimeZones) of the user.length ≥ 1 · length ≤ 255 · nullable
type*const"approximate"

BetaWebFetchTool_20250910object

allowed_callersBetaAllowedCaller[]
allowed_domainsstring[]List of domains to allow fetching fromnullable
blocked_domainsstring[]List of domains to block fetching fromnullable
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
citationsBetaRequestCitationsConfigCitations configuration for fetched documents. Citations are disabled by default.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
max_content_tokensintegerMaximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.n > 0 · nullable
max_usesintegerMaximum number of times the tool can be used in the API request.n > 0 · nullable
name*constName of the tool."web_fetch"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"web_fetch_20250910"
url_sourcesBetaWebFetchUrlSourcesWhich sources contribute to the set of URLs web fetch may fetch.nullable

BetaWebFetchTool_20260209object

allowed_callersBetaAllowedCaller[]
allowed_domainsstring[]List of domains to allow fetching fromnullable
blocked_domainsstring[]List of domains to block fetching fromnullable
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
citationsBetaRequestCitationsConfigCitations configuration for fetched documents. Citations are disabled by default.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
max_content_tokensintegerMaximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.n > 0 · nullable
max_usesintegerMaximum number of times the tool can be used in the API request.n > 0 · nullable
name*constName of the tool."web_fetch"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"web_fetch_20260209"
url_sourcesBetaWebFetchUrlSourcesWhich sources contribute to the set of URLs web fetch may fetch.nullable

BetaWebFetchTool_20260309object

Web fetch tool with use_cache parameter for bypassing cached content.

allowed_callersBetaAllowedCaller[]
allowed_domainsstring[]List of domains to allow fetching fromnullable
blocked_domainsstring[]List of domains to block fetching fromnullable
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
citationsBetaRequestCitationsConfigCitations configuration for fetched documents. Citations are disabled by default.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
max_content_tokensintegerMaximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.n > 0 · nullable
max_usesintegerMaximum number of times the tool can be used in the API request.n > 0 · nullable
name*constName of the tool."web_fetch"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"web_fetch_20260309"
url_sourcesBetaWebFetchUrlSourcesWhich sources contribute to the set of URLs web fetch may fetch.nullable
use_cachebooleanWhether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.

BetaWebFetchTool_20260318object

allowed_callersBetaAllowedCaller[]
allowed_domainsstring[]List of domains to allow fetching fromnullable
blocked_domainsstring[]List of domains to block fetching fromnullable
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
citationsBetaRequestCitationsConfigCitations configuration for fetched documents. Citations are disabled by default.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
max_content_tokensintegerMaximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.n > 0 · nullable
max_usesintegerMaximum number of times the tool can be used in the API request.n > 0 · nullable
name*constName of the tool."web_fetch"
response_inclusionenumHow this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely…full | excluded
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"web_fetch_20260318"
url_sourcesBetaWebFetchUrlSourcesWhich sources contribute to the set of URLs web fetch may fetch.nullable
use_cachebooleanWhether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.

BetaWebFetchToolResultErrorCodeenum

invalid_tool_input | url_too_long | url_not_allowed | url_not_in_prior_context | url_not_accessible | unsupported_content_type · +4 more

BetaWebFetchUrlSourceAllobject

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

type*const"all"

BetaWebFetchUrlSourceExceptobject

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

tools*BetaWebFetchUrlSourceToolReference[]
type*const"except"

BetaWebFetchUrlSourceNoneobject

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

type*const"none"

BetaWebFetchUrlSourceOnlyobject

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

tools*BetaWebFetchUrlSourceToolReference[]
type*const"only"

BetaWebFetchUrlSourcesobject

Which sources contribute to the set of URLs web fetch may fetch.

client_tool_resultsWebFetchUrlSourceAll | WebFetchUrlSourceNone | WebFetchUrlSourceOnly | …Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].
server_tool_resultsWebFetchUrlSourceAll | WebFetchUrlSourceNone | WebFetchUrlSourceOnly | …Which server tools' results contribute fetchable URLs: "all", "none", or an only or except list of server tool names from tools[]; only web_search and web_fetch results ever contribute.
user_inputWebFetchUrlSourceAll | WebFetchUrlSourceNoneWhether URLs in user messages are fetchable: "all" or "none".

BetaWebFetchUrlSourceToolReferenceobject

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

name*string
type*const"tool_reference"

BetaWebSearchTool_20250305object

allowed_callersBetaAllowedCaller[]
allowed_domainsstring[]If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.nullable
blocked_domainsstring[]If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.nullable
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
max_usesintegerMaximum number of times the tool can be used in the API request.n > 0 · nullable
name*constName of the tool."web_search"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"web_search_20250305"
user_locationBetaUserLocationParameters for the user's location. Used to provide more relevant search results.nullable

BetaWebSearchTool_20260209object

allowed_callersBetaAllowedCaller[]
allowed_domainsstring[]If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.nullable
blocked_domainsstring[]If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.nullable
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
max_usesintegerMaximum number of times the tool can be used in the API request.n > 0 · nullable
name*constName of the tool."web_search"
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"web_search_20260209"
user_locationBetaUserLocationParameters for the user's location. Used to provide more relevant search results.nullable

BetaWebSearchTool_20260318object

allowed_callersBetaAllowedCaller[]
allowed_domainsstring[]If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.nullable
blocked_domainsstring[]If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.nullable
cache_controlBetaCacheControlEphemeralCreate a cache control breakpoint at this content block.nullable
defer_loadingbooleanIf true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
max_usesintegerMaximum number of times the tool can be used in the API request.n > 0 · nullable
name*constName of the tool."web_search"
response_inclusionenumHow this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely…full | excluded
strictbooleanWhen true, guarantees schema validation on tool names and inputs
type*const"web_search_20260318"
user_locationBetaUserLocationParameters for the user's location. Used to provide more relevant search results.nullable

BetaWebSearchToolResultErrorCodeenum

invalid_tool_input | unavailable | max_uses_exceeded | too_many_requests | query_too_long | request_too_large

Modelstring

The model that will complete your prompt.

22 known values

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"anthropic","endpointId":"v1/messages?beta=true","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}