/v1/schemas/anthropic/chat/v1/messages?beta=true?kind=output
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source trace690622377a5eedc0e9f2265ed755ee34dc0c52d35b47327f425777a550f45e1e{
"fetchedAt": 1794374425,
"extractorVersion": "2",
"verifiedAt": null
} |
Response body
13 properties · 12 required · 194 $defs| property | type | description | constraints |
|---|---|---|---|
| id* | string | Unique object identifier. | |
| type* | const | Object type. | "message" · default: "message" |
| role* | const | Conversational role of the generated message. | "assistant" · default: "assistant" |
| content* | BetaContentBlock[] | Content generated by the model. | |
| model* | string | The model that will complete your prompt. | 22 known values |
| stop_reason* | enum | The 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* | string | Which 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* | BetaRefusalStopDetails | Structured information about a refusal. | nullable |
| usage* | BetaUsage | Billing and rate-limit usage. | |
| diagnostics* | BetaDiagnostics | Request-level diagnostics: why the prompt cache could not fully reuse the prefix of the request named by `diagnostics.previous_message_id`. | nullable |
| context_management* | BetaResponseContextManagement | Context management response. Information about context management strategies applied during the request. | nullable |
| container* | BetaContainer | Information about the container used in the request (for the code execution tool) | nullable |
| input_transformations | BetaInputTransformation[] | 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 $defsBetaAdvisorMessageIterationUsageobject
Token usage for an advisor sub-inference iteration.
| cache_creation* | BetaCacheCreation | Breakdown of cached tokens by TTL | nullable |
| cache_creation_input_tokens* | integer | The number of input tokens used to create the cache entry. | n ≥ 0 · default: 0 |
| cache_read_input_tokens* | integer | The number of input tokens read from the cache. | n ≥ 0 · default: 0 |
| input_tokens* | integer | The number of input tokens which were used. | n ≥ 0 |
| model* | string | The model that will complete your prompt. | 22 known values |
| output_tokens* | integer | The number of output tokens which were used. | n ≥ 0 |
| type* | const | Usage for an advisor sub-inference iteration | "advisor_message" · default: "advisor_message" |
BetaAdvisorTool_20260301object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| caching | BetaCacheControlEphemeral | Caching 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_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| max_tokens | integer | Bounds 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_uses | integer | Maximum number of times the tool can be used in the API request. | n > 0 · nullable |
| model* | string | The model that will complete your prompt. | 22 known values |
| name* | const | Name of the tool. | "advisor" |
| strict | boolean | When 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* | string | format: 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_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "bash" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "bash_20241022" |
BetaBashTool_20250124object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "bash" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "bash_20250124" |
BetaBrowserCloseTabConfigobject
``close_tab``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserDoubleClickConfigobject
``double_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserFileUploadConfigobject
``file_upload``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserFindConfigobject
``find``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserFormInputConfigobject
``form_input``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserGetPageTextConfigobject
``get_page_text``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserHoldKeyConfigobject
``hold_key``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserHoverConfigobject
``hover``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserJavascriptExecConfigobject
``javascript_exec``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserKeyConfigobject
``key``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserLeftClickConfigobject
``left_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserLeftClickDragConfigobject
``left_click_drag``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserLeftMouseDownConfigobject
``left_mouse_down``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserLeftMouseUpConfigobject
``left_mouse_up``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserListTabsConfigobject
``list_tabs``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserMiddleClickConfigobject
``middle_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserMouseMoveConfigobject
``mouse_move``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserNewTabConfigobject
``new_tab``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserReadConsoleConfigobject
``read_console``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserReadNetworkConfigobject
``read_network``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserReadPageConfigobject
``read_page``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserRightClickConfigobject
``right_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserScreenshotConfigobject
``screenshot``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserScrollConfigobject
``scroll``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserScrollToConfigobject
``scroll_to``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserSwitchTabConfigobject
``switch_tab``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | 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_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| configs | BetaBrowserToolsetConfigs | 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… | 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_tab | BetaBrowserCloseTabConfig | ``close_tab``'s config overrides. | nullable |
| double_click | BetaBrowserDoubleClickConfig | ``double_click``'s config overrides. | nullable |
| file_upload | BetaBrowserFileUploadConfig | ``file_upload``'s config overrides. | nullable |
| find | BetaBrowserFindConfig | ``find``'s config overrides. | nullable |
| form_input | BetaBrowserFormInputConfig | ``form_input``'s config overrides. | nullable |
| get_page_text | BetaBrowserGetPageTextConfig | ``get_page_text``'s config overrides. | nullable |
| hold_key | BetaBrowserHoldKeyConfig | ``hold_key``'s config overrides. | nullable |
| hover | BetaBrowserHoverConfig | ``hover``'s config overrides. | nullable |
| javascript_exec | BetaBrowserJavascriptExecConfig | ``javascript_exec``'s config overrides. | nullable |
| key | BetaBrowserKeyConfig | ``key``'s config overrides. | nullable |
| left_click | BetaBrowserLeftClickConfig | ``left_click``'s config overrides. | nullable |
| left_click_drag | BetaBrowserLeftClickDragConfig | ``left_click_drag``'s config overrides. | nullable |
| left_mouse_down | BetaBrowserLeftMouseDownConfig | ``left_mouse_down``'s config overrides. | nullable |
| left_mouse_up | BetaBrowserLeftMouseUpConfig | ``left_mouse_up``'s config overrides. | nullable |
| list_tabs | BetaBrowserListTabsConfig | ``list_tabs``'s config overrides. | nullable |
| middle_click | BetaBrowserMiddleClickConfig | ``middle_click``'s config overrides. | nullable |
| mouse_move | BetaBrowserMouseMoveConfig | ``mouse_move``'s config overrides. | nullable |
| navigate | BetaBrowserNavigateConfig | ``navigate``'s config overrides. | nullable |
| new_tab | BetaBrowserNewTabConfig | ``new_tab``'s config overrides. | nullable |
| read_console | BetaBrowserReadConsoleConfig | ``read_console``'s config overrides. | nullable |
| read_network | BetaBrowserReadNetworkConfig | ``read_network``'s config overrides. | nullable |
| read_page | BetaBrowserReadPageConfig | ``read_page``'s config overrides. | nullable |
| right_click | BetaBrowserRightClickConfig | ``right_click``'s config overrides. | nullable |
| screenshot | BetaBrowserScreenshotConfig | ``screenshot``'s config overrides. | nullable |
| scroll | BetaBrowserScrollConfig | ``scroll``'s config overrides. | nullable |
| scroll_to | BetaBrowserScrollToConfig | ``scroll_to``'s config overrides. | nullable |
| switch_tab | BetaBrowserSwitchTabConfig | ``switch_tab``'s config overrides. | nullable |
| triple_click | BetaBrowserTripleClickConfig | ``triple_click``'s config overrides. | nullable |
| type | BetaBrowserTypeConfig | ``type``'s config overrides. | nullable |
| wait | BetaBrowserWaitConfig | ``wait``'s config overrides. | nullable |
| zoom | BetaBrowserZoomConfig | ``zoom``'s config overrides. | nullable |
BetaBrowserTripleClickConfigobject
``triple_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserTypeConfigobject
``type``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserWaitConfigobject
``wait``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaBrowserZoomConfigobject
``zoom``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaCacheControlEphemeralobject
| ttl | enum | The time-to-live for the cache control breakpoint. | 5m | 1h |
| type* | const | "ephemeral" |
BetaCacheCreationobject
| ephemeral_1h_input_tokens* | integer | The number of input tokens used to create the 1 hour cache entry. | n ≥ 0 · default: 0 |
| ephemeral_5m_input_tokens* | integer | The 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* | integer | Approximate 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* | integer | Approximate 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* | integer | Approximate 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* | integer | Approximate 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" |
BetaCodeExecutionTool_20250522object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| name* | const | Name of the tool. | "code_execution" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "code_execution_20250522" |
BetaCodeExecutionTool_20250825object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| name* | const | Name of the tool. | "code_execution" |
| strict | boolean | When 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_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| name* | const | Name of the tool. | "code_execution" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "code_execution_20260120" |
BetaCodeExecutionTool_20260521object
Code execution tool with REPL state persistence.
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| name* | const | Name of the tool. | "code_execution" |
| strict | boolean | When 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* | BetaCacheCreation | Breakdown of cached tokens by TTL | nullable |
| cache_creation_input_tokens* | integer | The number of input tokens used to create the cache entry. | n ≥ 0 · default: 0 |
| cache_read_input_tokens* | integer | The number of input tokens read from the cache. | n ≥ 0 · default: 0 |
| input_tokens* | integer | The number of input tokens which were used. | n ≥ 0 |
| output_tokens* | integer | The number of output tokens which were used. | n ≥ 0 |
| type* | const | Usage for a compaction iteration | "compaction" · default: "compaction" |
BetaComputerCursorPositionConfigobject
``cursor_position``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerDoubleClickConfigobject
``double_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerHoldKeyConfigobject
``hold_key``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerKeyConfigobject
``key``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerLeftClickConfigobject
``left_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerLeftClickDragConfigobject
``left_click_drag``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerLeftMouseDownConfigobject
``left_mouse_down``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerLeftMouseUpConfigobject
``left_mouse_up``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerMiddleClickConfigobject
``middle_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerMouseMoveConfigobject
``mouse_move``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerRightClickConfigobject
``right_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerScreenshotConfigobject
``screenshot``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerScrollConfigobject
``scroll``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | 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_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| configs | BetaComputerToolsetConfigs | 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 … | 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_position | BetaComputerCursorPositionConfig | ``cursor_position``'s config overrides. | nullable |
| double_click | BetaComputerDoubleClickConfig | ``double_click``'s config overrides. | nullable |
| hold_key | BetaComputerHoldKeyConfig | ``hold_key``'s config overrides. | nullable |
| key | BetaComputerKeyConfig | ``key``'s config overrides. | nullable |
| left_click | BetaComputerLeftClickConfig | ``left_click``'s config overrides. | nullable |
| left_click_drag | BetaComputerLeftClickDragConfig | ``left_click_drag``'s config overrides. | nullable |
| left_mouse_down | BetaComputerLeftMouseDownConfig | ``left_mouse_down``'s config overrides. | nullable |
| left_mouse_up | BetaComputerLeftMouseUpConfig | ``left_mouse_up``'s config overrides. | nullable |
| middle_click | BetaComputerMiddleClickConfig | ``middle_click``'s config overrides. | nullable |
| mouse_move | BetaComputerMouseMoveConfig | ``mouse_move``'s config overrides. | nullable |
| right_click | BetaComputerRightClickConfig | ``right_click``'s config overrides. | nullable |
| screenshot | BetaComputerScreenshotConfig | ``screenshot``'s config overrides. | nullable |
| scroll | BetaComputerScrollConfig | ``scroll``'s config overrides. | nullable |
| triple_click | BetaComputerTripleClickConfig | ``triple_click``'s config overrides. | nullable |
| type | BetaComputerTypeConfig | ``type``'s config overrides. | nullable |
| wait | BetaComputerWaitConfig | ``wait``'s config overrides. | nullable |
| zoom | BetaComputerZoomConfig | ``zoom``'s config overrides. | nullable |
BetaComputerTripleClickConfigobject
``triple_click``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerTypeConfigobject
``type``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerUseTool_20241022object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| display_height_px* | integer | The height of the display in pixels. | n ≥ 1 |
| display_number | integer | The X11 display number (e.g. 0, 1) for the display. | n ≥ 0 · nullable |
| display_width_px* | integer | The width of the display in pixels. | n ≥ 1 |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "computer" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "computer_20241022" |
BetaComputerUseTool_20250124object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| display_height_px* | integer | The height of the display in pixels. | n ≥ 1 |
| display_number | integer | The X11 display number (e.g. 0, 1) for the display. | n ≥ 0 · nullable |
| display_width_px* | integer | The width of the display in pixels. | n ≥ 1 |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "computer" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "computer_20250124" |
BetaComputerUseTool_20251124object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| display_height_px* | integer | The height of the display in pixels. | n ≥ 1 |
| display_number | integer | The X11 display number (e.g. 0, 1) for the display. | n ≥ 0 · nullable |
| display_width_px* | integer | The width of the display in pixels. | n ≥ 1 |
| enable_zoom | boolean | Whether to enable an action to take a zoomed-in screenshot of the screen. | |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "computer" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "computer_20251124" |
BetaComputerWaitConfigobject
``wait``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaComputerZoomConfigobject
``zoom``'s config overrides.
| defer_loading | boolean | Defer loading for this member. Must resolve to the same value on every enabled member of the toolset. | nullable |
| enabled | boolean | 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. | nullable |
BetaContainerobject
Information about the container used in the request (for the code execution tool)
| expires_at* | string | The time at which the container will expire. | format: date-time |
| id* | string | Identifier for the container used in this request | |
| skills* | BetaContainerSkill[] | Skills loaded in the container | nullable |
BetaContainerSkillobject
A skill that was loaded in a container (response model).
| skill_id* | string | Skill ID | length ≥ 1 · length ≤ 64 |
| type* | enum | Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined) | anthropic | custom |
| version* | string | The 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* | enum | Why the reprice was not applied. | body_mismatch | continuation_excluded | continuation_only | expired | invalid_target_model | not_enabled · +6 more |
| remove_to_redeem | string[] | 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 | FallbackCreditNotApplied | Whether 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* | BetaCacheCreation | Breakdown of cached tokens by TTL | nullable |
| cache_creation_input_tokens* | integer | The number of input tokens used to create the cache entry. | n ≥ 0 · default: 0 |
| cache_read_input_tokens* | integer | The number of input tokens read from the cache. | n ≥ 0 · default: 0 |
| input_tokens* | integer | The number of input tokens which were used. | n ≥ 0 |
| model* | string | The model that will complete your prompt. | 22 known values |
| output_tokens* | integer | The number of output tokens which were used. | n ≥ 0 |
| type* | const | Usage for the fallback-model attempt that served the response | "fallback_message" · default: "fallback_message" |
BetaFallbackRefusalTriggerobject
The `from` model declined for policy reasons.
| category* | string | The 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.
| description | string | The tool's description as the MCP server lists it. | nullable |
| input_schema* | object | 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). | length ≥ 1 |
BetaMCPToolConfigobject
Configuration for a specific tool in an MCP toolset.
| defer_loading | boolean | ||
| enabled | boolean |
BetaMCPToolDefaultConfigobject
Default configuration for tools in an MCP toolset.
| defer_loading | boolean | ||
| enabled | boolean |
BetaMCPToolsetobject
Configuration for a group of tools from an MCP server.
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| configs | object | Configuration overrides for specific tools, keyed by tool name | nullable |
| default_config | BetaMCPToolDefaultConfig | Default configuration applied to all tools from this server | |
| mcp_server_name* | string | Name of the MCP server to configure tools for | length ≥ 1 · length ≤ 255 |
| tools | BetaMCPTool[] | 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_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "memory" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "memory_20250818" |
BetaMessageIterationUsageobject
Token usage for a sampling iteration.
| cache_creation* | BetaCacheCreation | Breakdown of cached tokens by TTL | nullable |
| cache_creation_input_tokens* | integer | The number of input tokens used to create the cache entry. | n ≥ 0 · default: 0 |
| cache_read_input_tokens* | integer | The number of input tokens read from the cache. | n ≥ 0 · default: 0 |
| input_tokens* | integer | The number of input tokens which were used. | n ≥ 0 |
| model* | string | The model that will complete your prompt. | 22 known values · nullable |
| output_tokens* | integer | The number of output tokens which were used. | n ≥ 0 |
| type* | const | Usage for a sampling iteration | "message" · default: "message" |
BetaOutputTokensDetailsobject
| thinking_tokens* | integer | Number 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* | string | The policy category that triggered a refusal. | 5 known values · nullable |
| explanation* | string | Human-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* | string | Opaque 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* | boolean | Whether 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* | string | The 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
| enabled | boolean |
BetaResponseAdvisorRedactedResultBlockobject
| encrypted_content* | string | Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify. | |
| stop_reason* | string | The 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* | 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. | 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* | enum | max_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* | enum | invalid_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* | integer | n ≥ 0 | |
| document_title* | string | nullable | |
| end_char_index* | integer | ||
| file_id* | string | nullable | |
| start_char_index* | integer | n ≥ 0 | |
| type* | const | "char_location" · default: "char_location" |
BetaResponseCitationsConfigobject
| enabled* | boolean | default: false |
BetaResponseClearThinking20251015Editobject
| cleared_input_tokens* | integer | Number of input tokens cleared by this edit. | n ≥ 0 |
| cleared_thinking_turns* | integer | Number of thinking turns that were cleared. | n ≥ 0 |
| type* | const | The type of context management edit applied. | "clear_thinking_20251015" · default: "clear_thinking_20251015" |
BetaResponseClearToolUses20250919Editobject
| cleared_input_tokens* | integer | Number of input tokens cleared by this edit. | n ≥ 0 |
| cleared_tool_uses* | integer | Number of tool uses that were cleared. | n ≥ 0 |
| type* | const | The 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* | enum | invalid_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* | string | Summary of compacted content, or null if compaction failed | nullable |
| encrypted_content* | string | Opaque metadata from prior compaction, to be round-tripped verbatim | nullable |
| signature | string | Signature over the summary, to be sent back with the block verbatim | nullable |
| tool_changes | BetaResponseToolAdditionBlock | 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* | string | The full text of the cited block range, concatenated. | |
| document_index* | integer | n ≥ 0 | |
| document_title* | string | nullable | |
| end_block_index* | integer | Exclusive 0-based end index of the cited block range in the source's `content` array. | |
| file_id* | string | nullable | |
| start_block_index* | integer | 0-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* | BetaResponseCitationsConfig | Citation configuration for the document | nullable |
| source* | Base64PDFSource | PlainTextSource | ||
| title* | string | The title of the document | nullable |
| 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* | BetaResponseFallbackHopInfo | The model whose output ends at this point — the model that declined at this hop. When the declining hop is the requested model, its `model` echoes the top-level `model` string the caller sent (alias or canonical); when the declining hop is a fallback model, it… | |
| to* | BetaResponseFallbackHopInfo | The fallback model producing the content that follows this block. Its `model` is always the canonical id. | |
| trigger* | BetaFallbackRefusalTrigger | What caused the `from` model to hand over at this hop. | |
| type* | const | "fallback" · default: "fallback" |
BetaResponseFallbackHopInfoobject
Identifies one hop of a fallback transition.
| model* | string | The 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.
| description | string | ||
| 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* | boolean | default: false | |
| tool_use_id* | string | ||
| type* | const | "mcp_tool_result" · default: "mcp_tool_result" |
BetaResponseMCPToolUseBlockobject
| id* | string | ||
| input* | object | ||
| name* | string | The name of the MCP tool | |
| server_name* | string | The name of the MCP server | |
| type* | const | "mcp_tool_use" · default: "mcp_tool_use" |
BetaResponsePageLocationCitationobject
| cited_text* | string | ||
| document_index* | integer | n ≥ 0 | |
| document_title* | string | nullable | |
| end_page_number* | integer | ||
| file_id* | string | nullable | |
| start_page_number* | integer | n ≥ 1 | |
| type* | const | "page_location" · default: "page_location" |
BetaResponseRedactedThinkingBlockobject
| 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. | |
| type* | const | "redacted_thinking" · default: "redacted_thinking" |
BetaResponseSearchResultLocationCitationobject
| cited_text* | string | The full text of the cited block range, concatenated. | |
| end_block_index* | integer | Exclusive 0-based end index of the cited block range in the source's `content` array. | |
| search_result_index* | integer | 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. | n ≥ 0 |
| source* | string | ||
| start_block_index* | integer | 0-based index of the first cited block in the source's `content` array. | n ≥ 0 |
| title* | string | nullable | |
| type* | const | "search_result_location" · default: "search_result_location" |
BetaResponseServerToolUseBlockobject
| caller | DirectCaller | ServerToolCaller | ServerToolCaller_20260120 | ||
| id* | string | ||
| input* | object | ||
| name* | enum | advisor | 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* | string | length ≥ 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* | integer | nullable | |
| new_start* | integer | nullable | |
| old_lines* | integer | nullable | |
| old_start* | integer | nullable | |
| 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* | enum | invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | file_not_found | |
| error_message* | string | nullable | |
| type* | const | "text_editor_code_execution_tool… · default: "text_editor_code_execution_tool… |
BetaResponseTextEditorCodeExecutionViewResultBlockobject
| content* | string | ||
| file_type* | enum | text | image | pdf | |
| num_lines* | integer | nullable | |
| start_line* | integer | nullable | |
| total_lines* | integer | nullable | |
| type* | const | "text_editor_code_execution_view… · default: "text_editor_code_execution_view… |
BetaResponseThinkingBlockobject
| signature* | string | A value used to verify that this thinking block was generated by Claude when it is passed back to the API. | |
| thinking* | string | The text of Claude's thinking process for this block. | |
| type* | const | "thinking" · default: "thinking" |
BetaResponseToolobject
A custom tool definition, as sent.
| type | const | "custom" · nullable | |
| description | string | Description of what this tool does. | |
| name* | string | Name of the tool. | length ≥ 1 · length ≤ 128 |
| input_schema* | object | [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input. | |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| eager_input_streaming | boolean | Enable 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_callers | BetaAllowedCaller[] | ||
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| input_examples | object[] |
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* | string | length ≥ 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 | ResponseToolChangeMCPToolsetReference | A 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* | enum | invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded | |
| error_message* | string | nullable | |
| 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
| caller | DirectCaller | ServerToolCaller | ServerToolCaller_20260120 | ||
| id* | string | ||
| input* | object | ||
| name* | string | length ≥ 1 | |
| toolset_name | string | For 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* | string | ISO 8601 timestamp when the content was retrieved | nullable |
| type* | const | "web_fetch_result" · default: "web_fetch_result" | |
| url* | string | Fetched content URL |
BetaResponseWebFetchToolResultBlockobject
| caller | DirectCaller | ServerToolCaller | ServerToolCaller_20260120 | ||
| content* | ResponseWebFetchToolResultError | ResponseWebFetchResultBlock | ||
| tool_use_id* | string | ||
| type* | const | "web_fetch_tool_result" · default: "web_fetch_tool_result" |
BetaResponseWebFetchToolResultErrorobject
| error_code* | enum | invalid_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* | string | nullable | |
| title* | string | ||
| type* | const | "web_search_result" · default: "web_search_result" | |
| url* | string |
BetaResponseWebSearchResultLocationCitationobject
| cited_text* | string | ||
| encrypted_index* | string | ||
| title* | string | length ≤ 512 · nullable | |
| type* | const | "web_search_result_location" · default: "web_search_result_location" | |
| url* | string |
BetaResponseWebSearchToolResultBlockobject
| caller | DirectCaller | ServerToolCaller | ServerToolCaller_20260120 | ||
| content* | ResponseWebSearchToolResultError | BetaResponseWebSearchResultBlock[] | ||
| tool_use_id* | string | ||
| type* | const | "web_search_tool_result" · default: "web_search_tool_result" |
BetaResponseWebSearchToolResultErrorobject
| error_code* | enum | invalid_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* | integer | The number of web fetch tool requests. | n ≥ 0 · default: 0 |
| web_search_requests* | integer | The 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_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "str_replace_editor" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "text_editor_20241022" |
BetaTextEditor_20250124object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "str_replace_editor" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "text_editor_20250124" |
BetaTextEditor_20250429object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| input_examples | object[] | ||
| name* | const | Name of the tool. | "str_replace_based_edit_tool" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "text_editor_20250429" |
BetaTextEditor_20250728object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| input_examples | object[] | ||
| max_characters | integer | Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file. | n ≥ 1 · nullable |
| name* | const | Name of the tool. | "str_replace_based_edit_tool" |
| strict | boolean | When 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* | 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* | enum | 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 th… | model_binding_mismatch | prefix_binding_mismatch | organization_binding_mismatch | end_user_binding_mismatch |
| type* | const | Always `thinking_dropped` for this entry type. | "thinking_dropped" · default: "thinking_dropped" |
BetaThinkingMismatchAllowedInputTransformationobject
| 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* | enum | 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 th… | model_binding_mismatch | prefix_binding_mismatch | organization_binding_mismatch | end_user_binding_mismatch |
| type* | const | Always `thinking_mismatch_allowed` for this entry type. | "thinking_mismatch_allowed" · default: "thinking_mismatch_allowed" |
BetaToolSearchToolBM25_20251119object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| name* | const | Name of the tool. | "tool_search_tool_bm25" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | enum | tool_search_tool_bm25_20251119 | tool_search_tool_bm25 |
BetaToolSearchToolRegex_20251119object
| allowed_callers | BetaAllowedCaller[] | ||
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| name* | const | Name of the tool. | "tool_search_tool_regex" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | enum | tool_search_tool_regex_20251119… | tool_search_tool_regex |
BetaToolSearchToolResultErrorCodeenum
invalid_tool_input | unavailable | too_many_requests | execution_time_exceeded
BetaUsageobject
| cache_creation* | BetaCacheCreation | Breakdown of cached tokens by TTL | nullable |
| cache_creation_input_tokens* | integer | The number of input tokens used to create the cache entry. | n ≥ 0 · nullable |
| cache_read_input_tokens* | integer | The number of input tokens read from the cache. | n ≥ 0 · nullable |
| fallback_credit* | BetaFallbackCreditUsage | Outcome of the ``fallback_credit_token`` presented on this request. | nullable |
| inference_geo* | string | The geographic region where inference was performed for this request. | nullable |
| input_tokens* | integer | The 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* | integer | The number of output tokens which were used. | n ≥ 0 |
| output_tokens_details* | BetaOutputTokensDetails | Breakdown of output tokens by category. `output_tokens` remains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you. | nullable |
| server_tool_use* | BetaServerToolUsage | The number of server tool requests. | nullable |
| service_tier* | enum | If the request used the priority, standard, or batch tier. | standard | priority | batch · nullable |
| speed* | enum | The inference speed mode used for this request. | standard | fast · nullable |
BetaUserLocationobject
| city | string | The city of the user. | length ≥ 1 · length ≤ 255 · nullable |
| country | string | The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user. | length ≥ 2 · length ≤ 2 · nullable |
| region | string | The region of the user. | length ≥ 1 · length ≤ 255 · nullable |
| timezone | string | The [IANA timezone](https://nodatime.org/TimeZones) of the user. | length ≥ 1 · length ≤ 255 · nullable |
| type* | const | "approximate" |
BetaWebFetchTool_20250910object
| allowed_callers | BetaAllowedCaller[] | ||
| allowed_domains | string[] | List of domains to allow fetching from | nullable |
| blocked_domains | string[] | List of domains to block fetching from | nullable |
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| citations | BetaRequestCitationsConfig | Citations configuration for fetched documents. Citations are disabled by default. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| max_content_tokens | integer | Maximum 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_uses | integer | Maximum number of times the tool can be used in the API request. | n > 0 · nullable |
| name* | const | Name of the tool. | "web_fetch" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "web_fetch_20250910" | |
| url_sources | BetaWebFetchUrlSources | Which sources contribute to the set of URLs web fetch may fetch. | nullable |
BetaWebFetchTool_20260209object
| allowed_callers | BetaAllowedCaller[] | ||
| allowed_domains | string[] | List of domains to allow fetching from | nullable |
| blocked_domains | string[] | List of domains to block fetching from | nullable |
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| citations | BetaRequestCitationsConfig | Citations configuration for fetched documents. Citations are disabled by default. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| max_content_tokens | integer | Maximum 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_uses | integer | Maximum number of times the tool can be used in the API request. | n > 0 · nullable |
| name* | const | Name of the tool. | "web_fetch" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "web_fetch_20260209" | |
| url_sources | BetaWebFetchUrlSources | Which 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_callers | BetaAllowedCaller[] | ||
| allowed_domains | string[] | List of domains to allow fetching from | nullable |
| blocked_domains | string[] | List of domains to block fetching from | nullable |
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| citations | BetaRequestCitationsConfig | Citations configuration for fetched documents. Citations are disabled by default. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| max_content_tokens | integer | Maximum 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_uses | integer | Maximum number of times the tool can be used in the API request. | n > 0 · nullable |
| name* | const | Name of the tool. | "web_fetch" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "web_fetch_20260309" | |
| url_sources | BetaWebFetchUrlSources | Which sources contribute to the set of URLs web fetch may fetch. | nullable |
| use_cache | boolean | Whether 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_callers | BetaAllowedCaller[] | ||
| allowed_domains | string[] | List of domains to allow fetching from | nullable |
| blocked_domains | string[] | List of domains to block fetching from | nullable |
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| citations | BetaRequestCitationsConfig | Citations configuration for fetched documents. Citations are disabled by default. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| max_content_tokens | integer | Maximum 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_uses | integer | Maximum number of times the tool can be used in the API request. | n > 0 · nullable |
| name* | const | Name of the tool. | "web_fetch" |
| response_inclusion | enum | How 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 |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "web_fetch_20260318" | |
| url_sources | BetaWebFetchUrlSources | Which sources contribute to the set of URLs web fetch may fetch. | nullable |
| use_cache | boolean | Whether 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_results | WebFetchUrlSourceAll | 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_results | WebFetchUrlSourceAll | 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_input | WebFetchUrlSourceAll | WebFetchUrlSourceNone | Whether 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_callers | BetaAllowedCaller[] | ||
| allowed_domains | string[] | If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`. | nullable |
| blocked_domains | string[] | If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`. | nullable |
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| max_uses | integer | Maximum number of times the tool can be used in the API request. | n > 0 · nullable |
| name* | const | Name of the tool. | "web_search" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "web_search_20250305" | |
| user_location | BetaUserLocation | Parameters for the user's location. Used to provide more relevant search results. | nullable |
BetaWebSearchTool_20260209object
| allowed_callers | BetaAllowedCaller[] | ||
| allowed_domains | string[] | If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`. | nullable |
| blocked_domains | string[] | If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`. | nullable |
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| max_uses | integer | Maximum number of times the tool can be used in the API request. | n > 0 · nullable |
| name* | const | Name of the tool. | "web_search" |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "web_search_20260209" | |
| user_location | BetaUserLocation | Parameters for the user's location. Used to provide more relevant search results. | nullable |
BetaWebSearchTool_20260318object
| allowed_callers | BetaAllowedCaller[] | ||
| allowed_domains | string[] | If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`. | nullable |
| blocked_domains | string[] | If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`. | nullable |
| cache_control | BetaCacheControlEphemeral | Create a cache control breakpoint at this content block. | nullable |
| defer_loading | boolean | If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search. | |
| max_uses | integer | Maximum number of times the tool can be used in the API request. | n > 0 · nullable |
| name* | const | Name of the tool. | "web_search" |
| response_inclusion | enum | How 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 |
| strict | boolean | When true, guarantees schema validation on tool names and inputs | |
| type* | const | "web_search_20260318" | |
| user_location | BetaUserLocation | Parameters 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$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"anthropic","endpointId":"v1/messages?beta=true","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}